Just starting out with javascript and running into an issue,
This snippet of code seems to be working as expected:
function test(args){
return "12345 - "+args;
}
console.log(test("678910"));
However, this other piece of code is giving me trouble:
function test(args){
if(args = ""){
}
return "12345 - "+args;
}
console.log(test("678910"));
The value for [args] ends up being undefined and I'm having trouble figuring out why. It could possibly be related to the context, but I'm still confused by why nothing seems to be working. Any help would be greatly appreciated!