Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4
I think you can't directly include function like that in an object ,it needs to have a key Like start:function start() or whatever name you want
15th May 2020, 1:05 PM
Abhay
Abhay - avatar
+ 3
15th May 2020, 1:08 PM
ChaoticDawg
ChaoticDawg - avatar
+ 2
Dilyorbek Valijonov yes, that's also valid as of ES6.
15th May 2020, 1:20 PM
ChaoticDawg
ChaoticDawg - avatar
+ 2
Dilyorbek Valijonov Yes, typically you'd use methods with OOP class objects. It's usually best if you can help it to stick with one style or the other within a JS module IMO. It helps to reduce issues and errors. At least that's what I started doing for the most part, after a few facepalms. Lol
15th May 2020, 1:35 PM
ChaoticDawg
ChaoticDawg - avatar