Class Musescore error
Hi guys Iam trying to ran this code
class Note {
constructor(randomOrder, lenghtOne, lenghtTwo) {
this.randomOrder = randomOrder;
this.lenghtOne = lenghtOne;
this.lenghtTwo = lenghtTwo;
}
}
but it gives me following errors
Creating component failed
line 3: Unexpected token reserved word'
:'
line 4: Expected token
line 4: Expected a qualified name id
Do you know what is wrong ?
Comments
I never used that syntax for creating classes in MuseScore/Javascript.
This is the syntax I'm using is the following one and it is working fine:
And you can instantiate new objects the same way:
In reply to I never used that syntax for… by parkingb
Thanks man I just figured Musescore cant work with classes I must work with functions
In reply to Thanks man I just figured… by kamilio141414
Mu4 should support that, using a newer version of Qt which supports ECMA 6, which has classes.