Create an object with properties,

前端 未结 5 1725
名媛妹妹
名媛妹妹 2021-01-17 16:01

I am new to javascript... I trying to create an object- \"Flower\". Every Flower has it properties: price,color,height...

Can somebody give me an idea how to build i

5条回答
  •  天涯浪人
    2021-01-17 16:11

    flower= {
     price : function() { 
         console.log('Price is 78 $'); 
     },
     color: 'red',
     height : 23
    };
    
    flower.price();
    flower.height ;
    

提交回复
热议问题