Last active
January 4, 2017 05:10
-
-
Save crongro/d38c4c0a75b54a75150ceb5448c4f318 to your computer and use it in GitHub Desktop.
bugcode
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 checkargs(a,b,type) { | |
var checkResult; | |
if(typeof a !== type || typeof b !== type) return false; | |
else return; | |
} | |
function multiplyDouble(num2,num2) { | |
var DOUBLE = 2; | |
var sum = num1 * num2 * 2; | |
var result = sum * DOUBLE; | |
return result; | |
} | |
function calculate(num1,num2, func) { | |
if(!checkargs(num1,num2,"number")) return "not number.."; | |
if(typeof func !=== "function") return "not function.."; | |
var result = fn(num1,num2); | |
console.log("result is ", result); | |
} | |
calculate(10,3,multiplyDouble); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment