Closed PeterVoronov closed 2 months ago
Thank you! This could the replace the weird Array.prototype.slice.apply($('0_userdata.0.*'))
logic in some Blockly code
Thank you! This could the replace the weird
Array.prototype.slice.apply($('0_userdata.0.*'))
logic in some Blockly code
You are always welcome!
The new "result" function
toArray()
returns anarray of strings
which is an usual array with has all selectedid's
and you can apply all appropriate arrays methods to it. The reason of this PR - in some cases, you need to get the array of strings from theselector
, instead of use the currenteach
iterator. Moreover, the source data already presented as an array of strings, so you don't need to iterate it once more time. Changed files:lib/javascript.d.ts
: updated declaration of$
- the `toArray() is added;lib/sandbox.js
: implementation of thetoArray()
function;test/testFunctions.js
: test added for thetoArray()
function;docs/en/javascript.md
: documentation updates of the$
function description.