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
function init(color) { | |
function changeBackground() { | |
document.body.style.background = color; | |
} | |
changeBackground(); | |
} | |
window.addEventListener("click",function() { init('red') }); |
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
https://docs.google.com/document/d/[GOOGLE GENERATED FOLDERorFILE ID]/edit?rm=minimal | |
instead of "?usp=sharing" put "?rm=minimal" without quotation marks after /edit |
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 myArray = new Array(); | |
function getInterval (start, step, end, ommit){ | |
for (start; start <= end; start+= step) { | |
// if statement below works as exclusion by ommitting the end i.e. the end is excluded if end === ommit of course | |
if (start >= ommit) { | |
continue; | |
} | |
myArray.push([start]); | |
console.dir(myArray); | |
} |
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
function getInterval (start, step, end, ommit){ | |
for (start; start <= end; start+= step) { | |
if (start == ommit) { | |
continue; | |
if (start > ommit) { | |
continue; | |
} | |
} | |
var resultArr = [start, step, end, ommit]; | |
[start, step, end, ommit] = resultArr; |
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
function getInterval (start, step, end, ommit){ | |
for (start; start <= end; start+= step) { | |
if (start == ommit) { | |
continue; | |
if (start > ommit) { | |
continue; | |
} | |
} | |
document.write(start + "<br />"); | |
} |
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
function getInterval (start, step, end, ommit){ | |
for (start; start <= end; start+= step) { | |
if (start == ommit) { | |
continue; | |
if (start > ommit) { | |
continue; | |
} | |
} | |
document.write(start + "<br />"); | |
} |
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
// simplified interval function | |
function getInterval (start, step, end, ommit){ | |
for (start; start <= end; start+= step) { | |
if (start == ommit) { | |
continue; | |
if (start > ommit) { | |
continue; | |
} | |
} | |
document.write(start + "<br />"); |
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 str = ""; if string leave as a string */ | |
// var strToNum = ""; syntax "" to [] changed below | |
var strToNum = []; | |
rangeLabel: | |
for (var i = 0; i < 10; i++) { // start at zero i.e. i = 0 | |
if (i === 1 || i === 2) { // define numberOne and numberTwo as the numbers being omitted | |
continue rangeLabel; // please ommit number One and number Two by using keywoard continue | |
} | |
strToNum += i; |
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 NumbersFromOne = { | |
[Symbol.iterator]: ()=> { | |
var i = 0; | |
var myArr = ['myArr', 'is', 'iterable']; | |
return { | |
next: ()=> { | |
if (i < myArr.length) {return { value: myArr[i++], done: false };} | |
else {{return { value: "THIS MANUAL ITERATION IS DONE (TRUE)", done: true };} | |
} | |
} |
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 NumbersFromOne = { | |
[Symbol.iterator]: ()=> { | |
var i = 0; | |
return { | |
next: ()=> { | |
if (i < 11) {return { value: i++, done: false };} | |
else {{return { value: i++, done: true };} | |
} | |
} | |
}; |