function MyObj() {
this.number = 1;
}
var x = new String("Hi");
if (x.constructor == String)
[removed]("Object is a String");
[removed]("<br />");
var y = new MyObj;
if (y.constructor == MyObj)
[removed]("Object constructor is MyObj");
function array_max() {
var i, max = this[0];
for (i = 1; i < this.length; i++)
{
if(max < this[i])
max = this[i];
}
return max;
}
Array.prototype.max = array_max;
var myArray = new Array(7, 1, 3, 11, 25, 9);
[removed](myArray.max());
소스는 위와 같고 node 에서 실행해보면 document가 정의되지 않았다고 뜨는데
document를 뭐라고 정의해줘야 하는건 아니지않아?ㅠㅠ 왜 이런 오류가 뜨는지 이해가 안되는데
알려주라 ㄹㅇ루..
자바 들어간게문제
document는 브라우저에 있는거
...
oniiion // 아 그럼 이게 노드로 실행하는게 아니고 브라우저로 실행하는거야?
뭘 하나 했더니 저걸 왜 노드로 돌려 ㅋㅋㅋㅋ