JSFiddle - React, Tailwind, and code Playground

by ChangJoo Park

JavaScript

class Consult {
  constructor (jsonResponse) {
    this.cName = jsonResponse['cName'];
  }
  
  get clientName() {
	  return this.cName || '없음';
  }
}

const consult1 = new Consult({ cName: '테스터' })
const consult2 = new Consult({})

console.log(consult1.clientName)
console.log(consult2.clientName)