12.More Practice


#1

Help, with this code.
var bicycle = new Object();
bicycle.speed: 0,
bicycle.gear: 1;
bicycle.......................
@dookoo_de


#2

First of all:

Remove this image and post your code. Simple copy and paste it.
That help other user who use the search function to get an result!

Thanks


#3

You can do it on more ways:

object initializer

var bicycle={
    speed:0,
    gear:1,
    frame_material:"carbon fiber"
}

dot notation

var bicycle = new Object();
bicycle.speed= 0;
bicycle.gear= 1;
bicycle.frame_material="carbon fiber";

bracket notation

var bicycle = new Object();
bicycle["speed"]= 0;
bicycle["gear"]= 1;
bicycle["frame_material"]="carbon fiber";

read more about it here


#4

Thank you very much!