목록전체 글 (83)
종우의 컴퓨터 공간
const firstName = 'William'; const lastName = 'Johnson'; const tags = 'web design,web development,programming'; length (property; no paranthesis) console.log(firstName.length); //yields 7 concat(, , ...) console.log(firstName.concat(' Smith')); // yields "William Smith" toUpperCase(), toLowerCase() console.log(firstName.toUpperCase()); //yields "WILLIAM" console.log(firstName.toLowerCase()); //y..
Math Object - Math.PI //yields 3.141592... - Math.E //yields 2.7... - Math.round(2.4); //yields 2 - Math.cell(2.4); //yields 3 - Math.floor(2.4); //yields 2 - Math.sqrt(64); //yields 8 - Math.abs(-3); //yileds 3 - Math.pow(8, 2); //yields 64 - Math.min(2, 33, 4, 1, 66, 6, 3); //yields 1 - Math.max(2, 33, 4, 1, 66, 6, 3); //yields 66 - Math.random(); //generate random decimals (0.xxxx) - Math.flo..
someType(Number, Bool, Date, Array) to string - = String(); - = ().toString(); someType(String, Bool, Null, Array) to number - = Number() - = parseInt() - = parseFloat() - Bool과 Null 타입에서는 true는 1을, false와 null은 0을 반환한다. - String과 Array와 같은 숫자로 변환할 수 없는 경우에는 NaN(Not a Number)을 반환한다. Type Coersion(강제 형 변환) - 우리가 형 변환을 하는 것이 아니라 자바 스크립트 자체에서 알아서 해준다. const val1 = 5; const val2 = 6; const sum = val..
Primitive Data Type - stroed directly in the location the variable accesses - stored on the stack - String, Number, Boolean, Null, Undefined, Symbols(ES6) Reference Data Type - accessed by reference - objects that are stored on the heap - a pointer to a location in memory - Arrays, Object Literals, Functions, Dates, Anything Else... Dynamically Typed Language - Types are associated with values n..
var - ES6 이후부터 사용하지 않는다. let(변수) - 재할당(reassign)이 가능하다. - block level scope를 가진다. const(상수) - 재할당(reassign)이 불가능하다. - 처음 선언할 때 반드시 초기화(값 할당)을 해주어야 한다. - block level scope를 가진다. - 객체같은 경우에는 그 안의 필드의 값을 변경할 수는 있지만 그 객체 자체를 다른 객체로 변경할 수는 없다. - 배열같은 경우에도 그 안의 값에 추가를 하거나 삭제를 하는 등 변경은 가능 하지만 그 배열 자체를 다른 배열로 변경할 수는 없다. const person = { name: 'Jongwoo', age: 29 } person.name = 'James'; console.log(perso..
출처: https://www.youtube.com/watch?v=4wKTZsUp7TQ&ab_channel=%EB%AA%A8%ED%8A%B8%EB%AA%A8%ED%8A%B8TV
출처: https://www.youtube.com/watch?v=n6JyrGoMpiY&ab_channel=smilemedia