+ 3

JS : What exactly is CLASS and in what case do you need it?

like… class rect{ constructor … } I see classes being talked about a lot. I watch videos and read about it. I don’t see the need for it to be used. Why is so special? / Why is it that important?

2nd Jan 2022, 6:13 AM
Ginfio
Ginfio - avatar
5 Respuestas
+ 2
You can think of a class as a blueprint/set of rules to define objects, like how a ball is round, or a person has 2 legs and can walk. Classes are used to classify things in your programs and how it could relate to other things. It may also help reduce duplicated code. You'll understand how powerful classes can be with more knowledge and practice.
2nd Jan 2022, 6:29 AM
Charles Jones
Charles Jones - avatar
+ 3
Martin Taylor IF you have one, what is a real life case that YOU would use Class in?
2nd Jan 2022, 8:27 PM
Ginfio
Ginfio - avatar
+ 2
Charles Jones i see. I understand a little more after reading your comment and reading an article. IF you have one, what is a real life case that YOU would use Class in?
2nd Jan 2022, 8:16 AM
Ginfio
Ginfio - avatar