【问题标题】:How can i Input: Microwave ,,then my output will be price of Microwave and amount of Microwave with Javascript我如何输入:微波炉,然后我的输出将是微波炉的价格和带有Javascript的微波炉数量
【发布时间】:2022-06-12 13:47:05
【问题描述】:

enter image description here

let products = [
{name:'DVD Player', price:'2500',amount:'10'},
{name:'VCD Player', price:'2000',amount:'5'},
{name:'LCD TV', price:'24999',amount:'2'},
{name:'Plasma', price:'22499',amount:'1'},
{name:'Radio', price:'1200',amount:'10'},
{name:'Microwave', price:'2229',amount:'12'},
{name:'Fan', price:'850',amount:'10'},
{name:'Electric IRON', price:'799',amount:'3'},
{name:'Washing Machine', price:'6500',amount:'2'},
{name:'Refrigerator', price:'6999',amount:'6'},

]

示例: 输入:微波 产出:价格:2229,数量:12

输入:冰箱 产量:价格:6999,数量:6

【问题讨论】:

  • let products = [ {name:'DVD Player', price:'2500',amount:'10'}, {name:'VCD Player', price:'2000',amount:' 5'}, {name:'LCD TV', price:'24999',amount:'2'}, {name:'Plasma', price:'22499',amount:'1'}, {name:'Radio ', price:'1200',amount:'10'}, {name:'微波炉', price:'2229',amount:'12'}, {name:'风扇', price:'850',amount: '10'}, {name:'电熨斗', price:'799',amount:'3'}, {name:'洗衣机', price:'6500',amount:'2'}, {name: '冰箱',价格:'6999',金额:'6'},]

标签: javascript arrays for-loop object if-statement


猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-02-28
  • 2019-10-07
  • 1970-01-01
  • 2023-01-12
  • 2012-11-21
  • 2010-10-21
  • 1970-01-01
相关资源
最近更新 更多