Skip to content
loading...

re: JavaScript vs Java Pass by Value and Reference VIEW POST

FULL DISCUSSION
 

Shouldn't

const a;
const b = 8;

const b = a;

console.log(a); // will return 8

not print 8?

 

I should have probably used let in this example. Good catch.

 

Sorry but even with let, I don't think it works... Are you sure?

Yeah, I updated it to use var, at least for now.

code of conduct - report abuse