2013년 8월 14일 수요일

Javascript - 사용한것 기록중

document.getElementById('element ID').innerHTML = "";
=> clean the element like <div> and so on


console.log(var data);
=> write the variable to console


function foo(bar) {
       return bar;
}
=> this function return variable


data.sort(function(a, b){
return a.Number < b.Number ? -1 : a.Number > b.Number ? 1 : 0;
});
//데이터 정렬 오름차순
=> Array 객체 data내부의 sort 메소드를 사용,
     data 내용 a와 b비교할 때 각각의 Number란을 대소 구별 기준으로 삼았다.
참조: http://programmingsummaries.tistory.com/150


for(var i=0;i<data.length;i++)
=>for(var i in data)
=>for문의 함축적 표현 방법


자바 스크립트는 항상 call by value
함수를 변수처럼 인식.
참조: http://emflant.tistory.com/64

String class match() 메소드
string1.match(string2)
=> if it is matched return true
참조: http://blog.naver.com/mecca0515?Redirect=Log&logNo=60107858100



댓글 없음:

댓글 쓰기