β To iterate through each element in the array
β Perform a task on each element which returns a value
β Returns a new array with all returned values
β Not suitable if task doesn't return any value
β Array.prototype.reduce()
β Use Case
β To iterate through each element in the array
β Perform a task on each element which accumulates the previous returned value with current element to return a new value
β Example
β Sum of all items
β Max of all items
β Array.prototype.every()
β Use Case
β To iterate through elements in the array until a certain condition is not met
β The task performed on each element must return a boolean value
β Stops iterating when condition is not met. Hence, it's not suitable for skipping.
β To find the very first occurrence of a "substring" in the original string
β We can also mention from which index the occurrence should be checked
20. String.prototype.charAt()
β Use Case
β To fetch the character at a specific position of a string.
β The character fetched is in UTF-16 and returned as a string
ββ String.prototype.trim()
β Use Case
β To remove whitespace from both ends of a string
β To get the largest integer less than or, equals to the given number
ββ Math.random()
β Use Case
β To get a floating point pseudo random number in the range of 0 to less than 1
β It can be multiplied by any number to make a random number being generated in the range of 0 to less than that number
ββ setTimeout()
β Use Case
β To execute a function or, piece of code after a timer expires
β The code is executed only for once.
β It is an asynchronous function. It shouldn't be used where pausing of execution is intended.
ββ setInterval()
β Use Case
β To execute a function or, piece of code repeatedly with a fix time delay
β The code is ensured to be executed each time after the time delay. But not "exactly" after the time delay.
P.S: This is my personal roadmap. I could spend 1 to 2 hours daily for learning and practicing during 2020. And it took me ~1 year to finish logically. It may differ from person to person.
β Start with a bang: Simple Data Types
Schedule: 1st Month
Effort: 1 to 2 hours daily + Normal practice
Advantages
β’ Easily share coding memories across your team in real-time.
β’ Coding memories are generated automatically that scales well.
β’ No hard-dependency on any IDE. Easily switch between different IDEs.
β’ Install on any IDE with zero configurations.
β Arrays
β Creating an Array
β Iterate through Array
β Get an Element
β Search an Element
β Insert Element(s)
β Delete Element(s)
β Filter an Array
β Fetch a Sub-Array
β Merging Arrays
β Reverse Array
ββ Rotate Array