0

Class/var

Hello Why take var with JavaScript and not class ? Class is more easy no? Thank

2nd Dec 2018, 5:59 PM
Axelle
5 Answers
+ 5
Hello, 😊 Can you specifying your question correctly! Use the search bar! https://www.sololearn.com/post/10362/?ref=app Please, read our guidelines: https://www.sololearn.com/discuss/1316935/?ref=app An useful code for any new user here!;) https://code.sololearn.com/WvG0MJq2dQ6y/
2nd Dec 2018, 6:29 PM
Danijel Ivanović
Danijel Ivanović - avatar
+ 2
A class is meant to tie data and function together, and normally several values of data and several functions. I doesn't make sense to create a class for only one value and I also don't see how it can be easier than writing "var x=5". Unless... we're not talking about the same thing. Share your code?
2nd Dec 2018, 6:30 PM
HonFu
HonFu - avatar
+ 1
I still have no code I have just seen the Var and I cofounded but it is more clear now thank you
2nd Dec 2018, 7:24 PM
Axelle
0
Classes and variables are not the same thing.
2nd Dec 2018, 6:14 PM
HonFu
HonFu - avatar
0
wa can have any class with the same value and change it in javascript Ă d do the same thing with var...
2nd Dec 2018, 6:26 PM
Axelle