You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classAnimalprice:5# instance property according to the booksell: (customer) ->animal=newAnimalanimal.sell(newCustomer)
But when I checked generated JavaScript code it looks like price property was added to the prototype 😕...
Well, if you try to use it I guess in that case it will magically work because the number type in JavaScript is immutable, but let me just show you an example with mutable field:
According to the book (https://arcturo.github.io/library/coffeescript/03_classes.html) instance properties can be created in the following way:
But when I checked generated JavaScript code it looks like
price
property was added to the prototype 😕...Well, if you try to use it I guess in that case it will magically work because the number type in JavaScript is immutable, but let me just show you an example with mutable field:
So obviously
products
property was added to the prototype and it's shared by both instances.The text was updated successfully, but these errors were encountered: