[node js] 콜백 함수
cmd에서 node sample.js라고 하면 sample.js 안에 있는 javascript명령 하나하나 실행 만약 cmd에서 node라고만 치면 바로 적어서 실행 가능 > a = [3,1,2]; console.log(a) > [3,2,1] >a = [3,1,2]; a.sort();console.log(a)>[1,2,3] 만약 반대로 정렬하려면 ? >a = [3,1,2]; function b(v1,v2){return v2-v1};a.sort(b);console.log(a) //b라는 함수에의해서 sort의 기본적 동작 방법이 바뀐다..>[3.2.1] >a = [3,1,2]; function b(v1,v2){console.log('c',v1,v2)};a.sort(b);console.log(a);c 3 1..