This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="three-container"></div> | |
<div id="instructions"> | |
click and drag to control the animation | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var dataStructure = { "head": -1, "Sum":0, "Sequence": [] }; | |
var MSum = 5; | |
var seq = [1,2,3,7,5]; | |
// var MSum = 15; | |
// var seq = [1,2,3,4,5,6,7,8,9,10]; | |
var outcome = "-1"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Hoisting | |
console.log(`var before decleration : ${v}`); | |
console.log(`let before decleration : ${l}`); | |
console.log(`const before decleration : ${c}`); | |
var v = 'VAR' | |
let l = 'LET' | |
const c = 'CONST' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pokemon = { | |
id: 25, | |
name: 'Pikachu', | |
type: ['electric'], | |
ability: { | |
primary: 'Static', | |
hidden: 'Lightning Rod' | |
}, | |
moves: ['Quick Attack', 'Thunderbolt', 'Iron Tail', 'Volt Tackle'], | |
competative: [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(() => { | |
"use strict"; | |
let pokemonTypes = ['electric', 'flying', 'fire', 'grass']; | |
let pikachu, pidgey, charizard, venusaur; | |
// pikachu = pokemonTypes[0]; | |
// pidgey = pokemonTypes[1]; | |
// charizard = pokemonTypes[2]; | |
// Skipping Values and default values. | |
[pikachu, , charizard, venusaur = 'NONE'] = pokemonTypes; | |
console.log(`Pikachu - ${pikachu}`); // electric |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let a = 34, b = 89; | |
console.log(`OLD - a :: ${a} | b :: ${b}`); // OLD - a :: 34 | b :: 89` | |
// Swap two variables | |
// let temp = a; | |
// a = b; | |
// b = temp; | |
// Destructuring assignment | |
[a,b] = [b,a]; | |
console.log(`NEW - a :: ${a} | b :: ${b}`); // NEW - a :: 89 | b :: 34 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let pokemon = { | |
"name": "Pikachu", | |
"id": 25, | |
"type": "electric", | |
}; | |
let { type, name, moves } = pokemon; | |
console.log(`Name :: ${name}`); | |
console.log(`Type :: ${type}`); | |
console.log(`moves :: ${moves}`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let pokemon = { | |
"name": "Pikachu", | |
"id": 25, | |
"type": "electric", | |
"ability": { | |
"primary": "Static", | |
"hidden": "Lightning rod" | |
}, | |
"moves": ["Quick Attack", "Volt Tackle", "Iron Tail", "Thunderbolt"] | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let arr = [10, 20]; | |
let one, two; | |
[one, two] = arr; | |
console.log(`${one} ${two}`); | |
let obj = { prop1: 'mxiv', prop2: 'UAE' }; | |
let name, location; | |
({ prop1: name, prop2: location } = obj); | |
console.log(`${name} ${location}`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let pokemon = { | |
"name": "Pikachu", | |
"id": 25, | |
"type": "electric", | |
"ability": { | |
"primary": "Static", | |
"hidden": "Lightning rod" | |
}, | |
"moves": [ | |
"Quick Attack", "Volt Tackle", "Iron Tail", "Thunderbolt" |
OlderNewer