Skip to Content
UX Design for Mobile
book

UX Design for Mobile

by Pau Giner, Pablo Perea
July 2017
Intermediate to advanced
354 pages
9h 58m
English
Packt Publishing
Content preview from UX Design for Mobile

Objects and methods

An object is a flexible type of data in which we can store a collection of properties consisting of pairs of keys and values, and methods are functions stored in the object. We can access the value of a property by calling the object and referencing its key. Here's an example of an object, created using the object literal definition, and how we access the cardHeight property using dot notation:

card =      cardHeight: 10    cardWidth: 10    cardColor: 222222   print card.cardHeight
Download prototype from Asset_A6462_A08_A06_Example_Card_Object.framer.zip.

With the print function, we get the value of the cardHeight property by the print console.

>> 10

Functions stored in objects are called methods, and they can get parameters when ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Practical UX Design

Practical UX Design

Scott Faranello
Designing UX: Forms

Designing UX: Forms

Jessica Enders
User Experience Design

User Experience Design

Satyam Kantamneni

Publisher Resources

ISBN: 9781787283428Supplemental Content