Last active
May 31, 2019 00:48
-
-
Save muratatak77/dd7007d4b2e32b0bbab7ca9d4b1f9a3e to your computer and use it in GitHub Desktop.
JS Bin// source https://jsbin.com/kovuhep - spread marker
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
function sumUp(...toAdd) { | |
console.log("toAdd : ", toAdd) | |
let result = 0; | |
for (let i = 0; i < toAdd.length; i++){ | |
result += toAdd[i] | |
} | |
return result; | |
} | |
total = sumUp(100,10,"20") | |
console.log(total); | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript"> | |
function sumUp(...toAdd) { | |
console.log("toAdd : ", toAdd) | |
let result = 0; | |
for (let i = 0; i < toAdd.length; i++){ | |
result += toAdd[i] | |
} | |
return result; | |
} | |
total = sumUp(100,10,"20") | |
console.log(total); | |
</script></body> | |
</html> |
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 sumUp(...toAdd) { | |
console.log("toAdd : ", toAdd) | |
let result = 0; | |
for (let i = 0; i < toAdd.length; i++){ | |
result += toAdd[i] | |
} | |
return result; | |
} | |
total = sumUp(100,10,"20") | |
console.log(total); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment