O'Reilly logo

Learn JavaScript with p5.js: Coding for Visual Learners by Engin Arslan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

© Engin Arslan 2018
Engin ArslanLearn JavaScript with p5.jshttps://doi.org/10.1007/978-1-4842-3426-6_9

9. Objects

Engin Arslan
(1)
Toronto, Ontario, Canada
 
JavaScript contains a data structure called Objects. Objects help you organize code and they make it easier to work with in certain cases. There are two ways of creating objects: by using an object initializer or by using constructor functions. In this chapter we’ll create a single object using an object initializer, while constructor functions act as a blueprint from which we can create many object instances using the new keyword.

Using Object Initializer

JavaScript uses a data structure called Object that helps organize data together. There are a couple of ways of creating an object in JavaScript. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required