js- monomer mode

Actual usage scenarios, the mall has to pay HK, RMB, US dollars. According to the user's information, set the currency symbol, the currency symbol to obtain in the page.

let currencySymbol = {
    currency: '¥',
    get: function() {
      return this.currency
    },
    set: function(currency) {
      this.currency = currency
    }
  }
  console.log(currencySymbol.get())
  currencySymbol.set('%')
  console.log(currencySymbol)

  

Guess you like

Origin www.cnblogs.com/fm060/p/11106283.html