Tested code in Emulator
a = [0,1,2,3,4] //=[ 0, 1, 2, 3, 4 ] a.length //=5 a.length = 3 //=3 a =[ 0, 1, 2, 3, 4, length: 3 ] // should return >a = [0,1,2]
Tested code in Google Chrome
a = [0,1,2,3,4] //(5) [0, 1, 2, 3, 4] a.length //5 a.length = 3 //3 a //(3) [0, 1, 2]
Workaround in Espruino
a = [0,1,2,3,4] //=[ 0, 1, 2, 3, 4 ] a = a.slice(0,3) //=[ 0, 1, 2 ] a.length //=3
@MaBe 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.
Tested code in Emulator
Tested code in Google Chrome
Workaround in Espruino