JS 문법 정리 (5)
·
Programming/JavaScript
0. Literals and properties one of the JS 's data types a collection of related data and/or functionality. Nearly all objects in JS are instances of object object = { key : value }; const obj1 = {}; // 'object literal' syntax const obj2 = new Object(); // 'object constructor' syntax function print(person){ console.log(person.name); console.log(person.age); } const cucu = { name : 'cucu', age : '1..
JS 문법 정리 (2)
·
Programming/JavaScript
0. String concatenation console.log(`string literals : '''' 1+2=${1+2}`); 1. Increment and decrement operators let counter = 2; const preIncrement = ++counter; counter = counter + 1; preIncrement = counter; const postIncrement = counter++; postIncrement = counter; counter = counter + 1; 2. Logical operators || or : finds the first truthy value value1 || value2 || check() // true 는 뒤로!! && and : ..