Answers for "javascript get from array"

VBA
145

javascript array

//create an array like so:
var colors = ["red","blue","green"];

//you can loop through an array like this:
for (var i = 0; i < colors.length; i++) {
    console.log(colors[i]);
}
Posted by: Guest on July-01-2019
6

js array from

console.log(Array.from('foo'));
// expected output: Array ["f", "o", "o"]

console.log(Array.from([1, 2, 3], x => x + x));
// expected output: Array [2, 4, 6]
Posted by: Guest on April-07-2020
3

return array javascript

function func() {
  return [5, "string", {a: 7}];
}
Posted by: Guest on May-20-2020

Code answers related to "javascript get from array"

Code answers related to "VBA"

Browse Popular Code Answers by Language