Skip to content

Instantly share code, notes, and snippets.

@gurucharanmk
Created April 24, 2016 15:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gurucharanmk/12dd7d39705d63d6520154b4c4f68829 to your computer and use it in GitHub Desktop.
Save gurucharanmk/12dd7d39705d63d6520154b4c4f68829 to your computer and use it in GitHub Desktop.
console.log("======================[Array]======================");
for (let x of ['a', 'b', 'c']) {
console.log(x);
}
//String
console.log("======================[String]======================");
for (let x of 'Hello World!') {
console.log(x);
}
//TypedArray
console.log("======================[Typed Array]======================");
var int16 = new Int16Array(2);
int16 = [1, 100];
for (let x of int16) {
console.log(x);
}
//Map
console.log("======================[Map]======================");
let map = new Map().set('Bob', 'bob@example.com').set('Doe', 'doe@example.com');
for (let pair of map) {
console.log(pair);
}
//Sets
console.log("======================[Set]======================");
let bool = new Set().add('0').add('1');
for (let x of bool) {
console.log(x);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment