I have very limited knowledge of JavaScript. Trying to script my IoT device with the help of a known LLM, I boiled down my issues to this:
let testArray = [3, 1, 2];
print("Does sort exist?", typeof testArray.sort); // Should print "function"
returning:
Does sort exist? undefined
So it looks like Shelly's version of JavaScript (Espruino, according to this) does not have .sort
on arrays. Printing the type of testArray
gives array
, not Array
.
It looks to me that scripting from within this Shelly device is going to be frustrating, as it seems not to follow a recent standard version of JavaScript.
Do I misunderstand something? Is there something I can do to make my Shelly Pro 1 sort an array?
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745103364a4611410.html
评论列表(0条)