how to get create an array in javascript
//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]);
}let fruits = ['Apple', 'Banana']
console.log(fruits.length)
// 2
let names = ['Michael', 'Adam', 'NetNinja'];
//now you are free to use the array
conosle.log(names[0]);
Also in JavaScript:
- js check if attribute exists
- javascript array merge
- react avatar editor to vuejs
- object find javascript
- jquery add div element
- vanilla javascript jwt authentication laravel
- lexical scope javascript
- node js mongoose text index
- javascript eval passing variable
- get a element using name in jquery
- GET req with js
- how to use a fixed time zone in nodejs
- port already in use node js
- how to write img jsx
- nuxtjs http multiple proxy
- js get base url
- basketball socket io
- how to submit a form in js
- javascript setattribute onclick function with parameters
- How many different types of JS alerts do we have?
- submitting login and sign up forms using AJAX
- target data option select vue js
- website login and registartion source code jsp java
- Unterminated quote at columns 0-8 ['MM-yyyy] in expression ['MM-yyyy]