I find myself typing this repeatedly for debugging in my code. Is there a way to create a function for this?
var abc = 1
console.log("abc = "+abc);
var xyz = 2;
console.log("xyz = "+xyz);
I would like to create a function like this:
logVar = function(input){
console.log(input.name()+" = "+input);
}
Is there a way to do this?
logVar(abc) should return "abc = 1"
logVar(xyz) should return "xyz = 2"