QML Javascript splice()
-
High, i am trying to splice an array i have that i use to store data. The array is pulled from a custom fileIO that returns a JSON object with the array inside... That in itself isn't a problem however splicing just doesnt work in QT 5.9 or am i doing it wrong..
function spliceTest() { var ar = ["t","t"]; console.log(ar.length); // return 2 which is what it should be.. ar.splice(1,1); // Array length should now be 1... console.log(ar) // returns "t", "t" What happened?? console.log(ar.length) // still returns 2... }
Any help would be greatly appreciated :D
Sinc., Alex
-
Hi,
Which exact version of Qt 5.9 are you using ?
Can you provide a minimal compilable project that shows that behaviour ?
-
Hi,
Which exact version of Qt 5.9 are you using ?
Can you provide a minimal compilable project that shows that behaviour ?
-
@SGaist Actually running the code on a different project gave me the correct results i guess it has something to do with my main project. I will attempt to see whats different between the two projects and why one is not running the splice command.