I want to create a log function where I can insert variable names like this:
var a = \'123\', b = \'abc\'; log([a, b]);
And the result sho
Something like this would do what you're looking for:
function log(logDict) { for (var item in logDict) { console.log(item + ": " + logDict[item]); } } function logSomeStuff() { var dict = {}; dict.a = "123"; dict.b = "abc"; log(dict); } logSomeStuff();