전체 글 (50) 썸네일형 리스트형 Express - res.json vs res.send res.json은 내부적으로 res.send를 호출하고 있으므로 Json 데이터를 보낼때는 -> res.json 사용 (json 데이터를 보낸다는 의도가 더 명확하게 드러나기도 함) Reference : https://haeguri.github.io/2018/12/30/compare-response-json-send-func/ [Javascript] 참조 타입 (Object Type) 생성 1. new, Object 이용 let person = new Object(); // let persoon = {} 과 동일 person.name = "dasom"; person.age = 20; console.log(person); 2. 객체 리티럴 표기법 (선호함) let person = { name : "dasom", age : 20, 5 : true // 프로퍼티 이름에는 문자열이나 숫자를 쓸 수 있다 (숫자는 자동으로 문자로 바뀐다) }; console.log(person); 사용 function displayInfo(args) { let output = ""; if(typeof args.name === "string"){ output += "Name : " + args.name + "\n.. 이전 1 ··· 4 5 6 7 다음