KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I understand how to instantiate objects and call them, but I just cannot find a reason to use them in my script. I could do var obj = { hi: function() { return "Hello"; } }; but why can't I just do it the same way like: function hi() { return "Hello"; } I've never understood the reasons why I should use prototyping either. Most of the things I do in JavaScript I can do well without objects. But I want to use objects. What are objects for and what are the reasons why I should use them?
Tags (comma-separated)
Save Edits
Cancel