+ 1
In JavaScript, its valid to set a variable to the keyword "undefined", but it is recommended that one never does this. Why❓
JavaScript... Under the hood
2 odpowiedzi
+ 3
It's redundant.
A variable without value is undefined by default, so there's no point in setting one.
+ 2
That makes sense, it's also important to note that leaving JavaScript to use that keyboard to describe one's undefined variables is crucial when debugging one's code. So yes it is definitely redundant lol, even though it is possible to set a variable as being undefined one should never do that, because that would make debugging a bit difficult. 😸