Event Loop:
The event loop is what allows Node.js to perform non-blocking I/O operations
node.js run all tasks in the call stack. If any task needs time to execute then that task moves to the event loop then node.js continues the remaining task. the event loop returns the task to call stack if the task will complete
Data type
There are two types of data types
- Primitive Data
-
string
-
number - NaN
-
boolean
-
undefined
-
Complex Data / reference data type - 2
-
function - function
-
object - objects, arrays, and null
Splice vs Slice:
Splice and Slice both are Javascript Array functions.
-
The splice() method returns the removed item(s) in an array and the slice() method returns the selected element(s) in an array, as a new array object.
-
The splice() method changes the original array and slice() method doesn’t change the original array.
some vs every
-
some will return true if any predicate is true
-
every will return true if all predicate is true
unshift
adds one or more elements to the beginning of an array and returns the new length of the array.
call vs apply
theFunction.apply(valueForThis, arrayOfArgs)
theFunction.call(valueForThis, arg1, arg2, ...)
0 Comments