Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript list all elements in set

var a = ['A', 'B', 'C'];
var s = new Set(['A', 'B', 'C']);
var m = new Map([[1, 'x'], [2, 'y'], [3, 'z']]);
for (var x of a) { // 遍历Array
    alert(x);
}
for (var x of s) { // 遍历Set
    alert(x);
}
for (var x of m) { // 遍历Map
    alert(x[0] + '=' + x[1]);
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: change on id 
Javascript :: get elements by class name wildcard 
Javascript :: golang read json file 
Javascript :: Get index of child elements with event listener in JavaScript 
Javascript :: string concat in js 
Javascript :: reduce function javascript 
Javascript :: graphql nested schema 
Javascript :: javascript static methods 
Javascript :: fibonacci sequence array 
Javascript :: javascript get date value from input 
Javascript :: module.exports equivalent typescript 
Javascript :: react native toggle button with text 
Javascript :: google places API details JS 
Javascript :: printing in javascript 
Javascript :: SELECT * FROM USERSs 
Javascript :: take off element form end of array 
Javascript :: change url without reloading the page 
Javascript :: how to get nested array using lodash 
Javascript :: how to read excel file in nodejs 
Javascript :: best way to filter table in angular 
Javascript :: javascript css 
Javascript :: angularjs select placeholder 
Javascript :: what is let js 
Javascript :: how to display message in javascript 
Javascript :: how to get length in js without using .length method 
Javascript :: js find intersection point 
Javascript :: flatmap js 
Javascript :: ajax stand for 
Javascript :: millis javascript 
Javascript :: LEAODE MAJE 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =