Author | Message |
---|---|
sbaral2
Posts: 11
|
Posted 00:11 Sep 30, 2016 |
Question 3 & 4) How to work with Array.prototype.map? From where in drawTable function will this be called? Thanks. Last edited by sbaral2 at
00:12 Sep 30, 2016.
|
edwinruizr
Posts: 1
|
Posted 07:09 Sep 30, 2016 |
Array.prototype.map is a method that all arrays have and it iterates through your array and performs a function(that you will pass it) on all elements of the array. The array.map method returns a new array.
The he way to call it is theNameOfYourArrayVariable.map(function(currentValue,index,arr), thisValue) good reference on how to use it from w3schools
array.map won't be called from the draw table code. You make a new function and use the map method to do what you want.
|
hieuphan005
Posts: 5
|
Posted 15:16 Sep 30, 2016 |
Another way to call the map function is Array.prototype.map.call(array,function) |