How to remove a specific item from a Javascript array

How would you go about removing a specific element from an array using vanilla Javascript? There’s probably multiple ways to solve this trivial problem. Here’s how I would remove the element “apple” from the following array. let arr = [“oranges”, “banana”, “apple”, “mango”, “watermelon”]; 1. Find the index corresponding to the “apple” element using the […]

How to reverse a string containing complicated emojis

Essentially what the title says. How on earth do we reverse this string? Hello world12👩‍👩‍👦‍👦3🍕✓ Before we get into that, lets look at how we can reverse a plain old ‘Hello, World’ string. For most of you out there, this task should be fairly trivial and might look something like this. 1. Split the string […]

Why is super(props) deprecated in the React class component?

Shown below is a perfectly fine (albeit very basic) React class that should be familiar to anyone who has meddled around with ReactJS. class App extends Component { constructor(props) { super(props); } render() { return <div>Hello, World!</div> } } So what is the problem? Well, since recently, users have noticed a deprecated warning for the […]