function lenc(m) {
"compiled";
var l = m.length(m);
return l;
}
function len() {
var m = "123.456";
console.log(lenc());
}
with len() entered/run in console complains:
1v80 Copyright 2015 G.Williams
>echo(0);
=undefined
>len()
undefined
=undefined
Uncaught Error: Expecting a function to call, got Number
at line 3 col 21
console.log(lenc(m));
^
in function "len" called from line 1 col 5
len()
^
>
I know that it should read var l = m.length; in lenc()... but I got there only after a while when my mind had let go of the deceipt by the error message and I took a closer look at lenc().
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.
with
len()
entered/run in console complains:I know that it should read
var l = m.length;
inlenc()
... but I got there only after a while when my mind had let go of the deceipt by the error message and I took a closer look atlenc()
.