Question from the Javascript test

What is the value of `obj.hello` after executing these few lines of code?

Hard

What isobj.hello value after executing these few lines of code?

var obj = { hello: 'Hello' }, hello = 'Hello';
obj[hello] += ',';
obj.hello += ' world';
obj['hello'] += '!';
Author: Jean-marie CléryStatus: PublishedQuestion passed 2095 times
Edit
4
Community Evaluations
developer avatar
Auteur anonyme
14/02/2022
outputs ' Helloworld!' in the console
developer avatar
Auteur anonyme
21/02/2022
Hello there. It seems to be an issue with the english translation. Thank you for the reporting. I fix it !
developer avatar
Auteur anonyme
10/03/2023
I tested the code here and it actually logs "Hello world!". The line `obj[hello] += ','` is useless tho.
developer avatar
Auteur anonyme
05/10/2023
I think it is the purpose of the test
developer avatar
Obsolete
Benoit
17/09/2024
cette question était obsolète il y a 8 ans