I am Struggling with this Object type, the first object type I created worked but what I don’t understand is why the second object is not working all.
Any help would appreciated
https://codepen.io/b97code/pen/ExZVMRj
I am Struggling with this Object type, the first object type I created worked but what I don’t understand is why the second object is not working all.
Any help would appreciated
Take a closer look at the capitalization in the second case.
name
has special meaning in JavaScript as it is already identified as the same thing as window.name
. You can either change the variable name to something else or you can use const
to declare it instead of var
.
thank you @RandellDawson , that worked
I didn’t know about the name
type in JavaScript
There’s always something new to learn from experienced developers
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.