0
Anyone else can think of ideas
Can you think of any ideas in JavaScript that are related to this code var courses=new.course("HTML5","CSS","JS") alert(courses)
1 Answer
+ 3
Related to your code, I can think to only one 'idea': << PEBCAK >> ( https://fr.m.wiktionary.org/wiki/PEBCAK ) :P
'new' is a reserved keyword in JS, so used as this it would produce an << unexpected identifier >> error...
The most probable good way of writing it, if you've previously defined a 'course' function-class, would be:
var courses = new course("HTML5","CSS","JS");
alert(courses);
... where it will display [object Object], while you doesn't override the .toString() method ^^