=== is not equal to
== then what does it equal???
First, let us define the two operators:
===is known as the Strict Equality Operator
==is the Abstract Equality Operator
They both behave the same, in that they both return a boolean value telling us if two expressions are equal.
A === B // returns true or false
Y == Z // also returns true or false
The difference is that the Strict Equality Operator (===) does no type conversion (also called type coercion).
1 == "1" // returns true1 === "1" // returns false as the type is not…
I recently started a job as a software developer and part of the draw was that I had the option to work from home.
Over the past 8 months, I’ve gradually adapted to a mixed week of 2/3 days of remote work, balanced with days in our London office.
For those who have been forced to working remotely since COVID-19, I want to assure you, this is not normal.
At this moment, you are not just “working from home.” You are “at your home, during a crisis, trying to work.” — Kelli María Korducki
Working during a pandemic, no matter how unaffected you feel, is significantly harder than normal. …
Well, you’re not alone!
If you want to remove an element while leaving the original array intact (unmutated) then
filter() is a good choice!
Removing a single element:
const itemToRemove = 3const originalArray = [2, 51, 3, 44]const newArray = originalArray.filter(item => item !== itemToRemove)console.log(newArray) // [2, 51, 44]
console.log(originalArray) // [2, 51, 3, 44]
Breaking that down.
We define a variable
newArray and set it equal to the return value of our array filter. Inside of our filter, we pass an ECMAScript 6 arrow function. …