This file contains hidden or 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
"Before Set-Time-Out" | |
"Outside Set-Time-Out" | |
"Inside Set-Time-Out" -->Would be printed after 1000 milliseconds | |
"Exiting Set-Time-Out after 1000 milliseconds" -->Would be printed after 1000 milliseconds |
This file contains hidden or 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
const flatten = arr => { | |
let i = 0; | |
while (i < arr.length) { | |
if (Array.isArray(arr[i])) { | |
arr.splice(i, 1, ...arr[i]); | |
} else { | |
i++; | |
} | |
} | |
return arr; |
This file contains hidden or 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
const TIME_OUT = 1000; | |
function start(){ | |
console.log("Before Set-Time-Out"); | |
setTimeout(function(){ | |
console.log("Inside Set-Time-Out","Exiting Set-Time-Out after "+TIME_OUT+" milliseconds"); | |
},TIME_OUT); | |
console.log("Outside Set-Time-Out"); | |
} | |
start(); |
This file contains hidden or 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
<html> | |
<head> | |
</head> | |
<body> | |
<script src="lib/yourlib.js"></script> | |
<script> | |
window.onload = function () { | |
EntryPoint.run(); | |
}; | |
</script> |
This file contains hidden or 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
//1. | |
var x; | |
x++; | |
console.log(x); | |
//Output:NaN | |
//2. | |
//Check whether a number is NaN with out using isNaN |
NewerOlder