Today #day35 of #100daysofcode, I have completed 5.34 and one code practice problems and 5.35 module 5 quiz and 5.36 "contact manager" code project in JS course. @Sololearn
Objects
adding methods
Methods
- Methods are functions that are stored as object properties.
- syntax:
methodName = function() { code lines }
- syntax to access method:
objectName.methodName()
- A method is a function, belonging to an object. It can be referenced using the this keyword.
- You can also define the function outside of the constructor function and associate it with the object.
- Note that it's not necessary to write the function's parentheses when assigning it to an object.
Code: click
Images of lesson completed
Conclusion
- Methods
- method functions
- quiz
- contact manager code project