Training day 18 - JavaScript Basic to Beginners [Arrays]

Heloo people!!

These are the notes of what I learned:

Objects

Factory function

Function createCircle() { Const circle = { Radius: 1,

}

}

numbers.shift() - add numbers to start of the array numbers.splice() - add numbers at particular position numbers.indexOf() - returns the index of element in the array

numbers.find() - it takes a function as a parameter, which can help define, what to find in the array.

numbers.pop() - remove the last element from the array and. returns it numbers.shift() - removes element from the beginning and returns it

Emptying an array: Numbers = [] numbers.length(0, numbers.length)

concat() - combine two arrays slice() - slice two arrays

Spread operator Const combines = […first, …second];

Array to string Const joined = numbers.join(‘,’);

String to array Const parts = message.split(‘ ‘);

numbers.every() - checks to see if every element in the array matches the criteria given numbers.some() - check if at least one element in the array matches the given criteria

//Function Declaration walk();

Function walk() { console.log(‘walk’); }

//Function Expression

run() //can’t do that

Const run = function() { console.log(‘run’); }