Trying to understand the concept of JavaScript object through ads and vending machines

To understand the concept of JavaScript objects, I sometimes draw hints from what I see when I go to work.

Today, an ad on the commuter train drew my eyes.

It was an invitation to the membership for elderly people to get discount from train tickets.

The diagram which describe examples of discounts especially drew my eyes.

Each row contained a pair of the origin and the destination, its regular price, its discounted price, and the amount you can save with the membership.

This diagram stimulated my curiosity to define a structure of a data object "discount".


As well as the ad, a vending machine also invoked my curiosity. Drinks, their categories and contents, and their prices. This also can be seen as objects.
I was also interested in the event in front of a vending machine. Put it in a coin, push a button corresponded to the drink you want, and you actually get a drink.

You may not get a real drink by a data object simulating a vending machine, but to make believe that you buy a drink from this simulated machine, I felt that it help me understand what a series of event on a web browser like.

Comments

Popular posts from this blog

Slow Burst

It's my lack of confidence that is to be beaten