-
-
-
-
-
Many thanks DrAzzy
It would be a nice feature in the espruino enviroment. With getters and setters nice objectoriented implementations could be made like:
mycar.light='on'; // Hidden catch function implements the functionality
If(mycar.ambientsensor<=5) { mycar.light='on'; } // Provided by the hidden getter function, done as above.
Best regards
Sacha
-
Hi Gordon
I just found learned the functionality of get and set.
Code:
var person = {
_name: 'Marion',
get name() {
console.log('read\n');
return this._name;
},
set name(value) {console.log('write\n'); this._name=value;
}
};person.name='Michelle';
I just got a syntax error. Any chance that this will work on espruino too ?
Thanks
Sacha
-
-
-
-
-
-
-
-
-
-
-
-
Hi Gordon,
It was not easy to isolate the following problem:
The Code:
a=16;
b=16;
console.log('A:'+a);
console.log('B:'+b);
console.log('AND Result1:'+(a&b));a=16;
b=Math.pow(2,4); // Also 16
console.log('A:'+a);
console.log('B:'+b);
console.log('AND Result2:'+(a&b));Espruino Output:
1v63 Copyright 2014 G.Williams
echo(0);
A:16
B:16
AND Result1:16
A:16
B:16
AND Result2:0
=undefinedOn jsoncole.com, the output is the following. See "AND Result2", should be 16 too.
A:16
B:16
AND Result1:16
A:16
B:16
AND Result2:16Thanks
Sacha
-
-
-
-
-
Win10 64 bit. Lenovo Yoga 3 Pro. Driver error. see screenshot. Installed driver http://www.st.com/web/en/catalog/tools/PF257938. Same error.