When i look the console. before the set, types in array are Edition objects but in the get they are Object objects. So when later i want to use in a indexOf to find if a certain value exist it fails.
How can i have the right type during the get Process.
(I have also tried using JSON.stringify and JSON.parse function but i have the same result)
You can’t. JavaScript doesn’t really have any OO functionality - it is all smoke and mirrors. Hence I recommend using interfaces to store data, moving all fancy logic that you may have in your data object class into a service provider instead.
Depending on your needs there are other ways like having the constructor take in the object and set properties, then you could loop through your raw object and construct models from them.
As rapropros says you could also use interfaces if you only care about type checking and not having methods on the models.