Skip to content

Instantly share code, notes, and snippets.

@efleming969
Created June 20, 2013 20:18
Show Gist options
  • Select an option

  • Save efleming969/5826226 to your computer and use it in GitHub Desktop.

Select an option

Save efleming969/5826226 to your computer and use it in GitHub Desktop.
var calc = (function () {
function parse (str) {
return str.split(",")
}
function replace (str) {
return str.replace(";", ",")
}
function replaceRegEx (str) {
var re = /[,;\n]/g
return str.replace(re, ",")
}
return {
parse: parse,
replace: replace,
replaceRegEx: replaceRegEx
}
}())
if (str == "") {
return 0
}
else {
return parseInt(str)
}
var nums = ["1", "2", "3"];
var sum = 0;
throw new Error("foo")
for (var i = 0; i < nums.length; i++) {
sum = sum + parseInt(num[i]);
}
@efleming969
Copy link
Copy Markdown
Author

this is cool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment