Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
9
Task/100-doors/JavaScript/100-doors-5.js
Normal file
9
Task/100-doors/JavaScript/100-doors-5.js
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
Array.apply(null, { length: 100 })
|
||||
.map((v, i) => i + 1)
|
||||
.forEach(door => {
|
||||
var sqrt = Math.sqrt(door);
|
||||
|
||||
if (sqrt === (sqrt | 0)) {
|
||||
console.log("Door %d is open", door);
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue