Assume this simple Person 'class' definition with just value properties:
var Person = function(name) { this.name = name; };
Compare now both of these syntactically correct Person 'method' definitions:
Definition 1:
Person.prototype.spelled = function() { return this.name.split("").join(" - "); };
Definition 2:
Why is 1 working and 2 throws the following runtime error:
Uncaught SyntaxError: Got '=' expected EOF at line 1 col 5 = function() { return this.name.split('').join(' = '); }...
Has Espruino's rigid statement completion by semi-colon policy changed?
@allObjects started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Assume this simple Person 'class' definition with just value properties:
Compare now both of these syntactically correct Person 'method' definitions:
Definition 1:
Definition 2:
Why is 1 working and 2 throws the following runtime error:
Has Espruino's rigid statement completion by semi-colon policy changed?