08.
Legit JavaScript Classes
Keep on Learning!
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
Whoops, an error! Please, try again later.
5 Comments
Hello, can someone explain me why the function updateTotalWeightLifted is not a static and don't begin with underscore like _addRow for example, Thx :)
Hey Miloud
That method cannot be static because it uses some properties of the class, and the "under score" convention for naming methods is for specifying which methods should be considered as "private", just like if you were declaring a "private function" in PHP
Cheers!
Hi @Diego sorry for the confusion between static and private, but i don"t understand yet the diffecrence bettwen _addRow and updateTotalWeightLifted, why updateTotalWeightLifted dosn't start with underscore like addRow for example ?
In this case, I think it's ok because that function seems like you may want to use it from outside of the class. It just updates the total, but anyways, you can always add that "underscore" if you find any method not being used from outside (as soon as you need that, then you can refactor that method's name)
MolloKhan it's clear, thank you very much for the explanations :)
Cheers!
"Houston: no signs of life"
Start the conversation!