-
[Javascript] 함수에서 여러 값을 받고 싶다면problems 2020. 4. 18. 16:26
배열 또는 객체를 출력합니다.
Array
function returnArr(){ return ['Hello', 'world!'] } let words = returnArr() // ['Hello', 'world!'] console.log(words[0] + ' ' + words[1]) // Hello world!
Object
function returnObj(){ let obj = {first: Steve, last: Jobs} return obj } let name = {} name = returnObj() // {first: Steve, last: Jobs} console.log(name.first + ' ' + name.last) // Steve Jobs
'problems' 카테고리의 다른 글
[201023]GraphQL only supports GET and POST requests. (0) 2020.10.23 [201021]Query engine binary for current platform "debian-openssl -1.1x" could not be found (0) 2020.10.21 git remote add가 실행되지 않는다면 (0) 2020.04.27 백슬래시 - escaping sequence (0) 2020.04.24 [Javascript] 의도하지 않은 상황에는 오류발생시키기 (0) 2020.04.18