IT/Javascript
자바스크립트 array, 객체, 함수
1am_wish
2022. 9. 20. 23:18
728x90
반응형
- array
- 선언 const numbers = [1,2,3,4,5]
- 삽입 numbers.push(6)
- 객체
- 선언 const player = { name : "sowon", points : 10, power : false, };
- 호출
- player.name
- player["name"]
- 추가 player.lastName = "choi"
const player = {
name : "sowon",
points : 10,
power : false,
sayHello: function(otherPersonName){
console.log("hello "+otherPersonName);
}
};
player.lastName = "choi"
player.sayHello("hong");
- 형변환
- parseInt
- Nan : not a number
- isNan 함수
- Nan : not a number
- parseInt
728x90
반응형