3.2 refresh table functions
In the last course we reviewed the reference of primitive types an important element to keep in mind when you use JavaScript another Things you will see in this course are the array functions we will review the good old table one two and three as we had observed Numbers is equal to 1, 2, 3 don’t forget to put, between each figure now suppose that we wanted to transform this into an array in which each number is doubled we must therefore double numarray Which allows us to use an array function we can take the array of numbers and call the map the map is an integrated array method all JavaScript methods you the next generation works in the same way although it takes an input function and this function which is an arrow function
but which could be a normal function and then simply execute on each element of the table of the shot we will do them as this equals and the arrow do not forget the parenthesis here so on each element of the table of the number 1, 2 and 3 is a number at the end we can return then simply something is what you have to do in this intern function depends on the function domain you use so in the map function we have to return the new value to which we want transform the old so that we can return Num two and that this is executed on each element here it will return 2, 4 and six so a real new array which is then stored in double numarray so here we are instead of Numbers double Num Array Excuse me for my English accent which is not famous now if I look at it works thanks to have looked