일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- graphQL
- CLASS
- tailwindcss
- solidity
- Props
- concept
- 기준
- API
- useState
- CSS
- error
- Interface
- Ethereum
- built in object
- blockchain
- web
- bitcoin
- JavaScript
- HTML
- nextJS
- hardhat
- Redux
- SSR
- express.js
- node.js
- evm
- 삶
- middleware
- typeScript
- REACT
- Today
- Total
목록JavaScript (53)
ReasonJun
// key.js export const birthKey = Symbol('Date of birth'); export const emailKey = Symbol('Emails'); // youjun.js import { birthKey, emailKey } from './key'; export default { firstName: 'youjun', lastName: 'park', age: 22, [birthKey]: new Date(1985, 11, 16, 17, 30), [emailKey]: ['thiehis@gmail.com'], }; // main.js import youjun from './youjun.js'; import { birthKey, emailKey } from './key.js'; c..
spread const a = [1, 2, 3]; console.log(...a); // 1 2 3 const b = [4, 5, 6]; const c = a.concat(b); console.log(c); // [ 1, 2, 3, 4, 5, 6 ] const d = [a, b]; console.log(d); // [ [ 1, 2, 3 ], [ 4, 5, 6 ] ] const e = [...a, ...b]; console.log(e); // [ 1, 2, 3, 4, 5, 6 ] const aa = { x: 1, y: 2 }; const bb = { y: 3, z: 4 }; const cc = Object.assign({}, aa, bb); console.log(cc); // { x: 1, y: 3, z:..
while / do while // while let n = 0; while (n < 4) { console.log(n); n += 1; } // 0 // 1 // 2 // 3 // do while do { console.log(n); n += 1; } while (n < 4); // 0 // 1 // 2 // 3 // 4 switch function price(fruit) { switch (fruit) { case 'apple': return 1000; case 'banana': return 1500; default: return 0; } } console.log(price('apple')); // 1000 console.log(price('banana')); // 1500 console.log(pri..
show data //? .length // Returns the length (number) of an array. const arr = ['a', 'b', 'c']; console.log(arr.length); // 3 //? .at() // Index the target array. console.log(arr[0]); // a console.log(arr.at(0)); // a console.log(arr.at(-1)); // c //? .find() // Returns the first element in the target array that passes the callback test. const arr = [5, 8, 130, 12, 44]; const foundItem = arr.find..
function declaration // function declaration function hello() { console.log('hello'); } hello(); // hello console.log(hello); // [Function: hello] console.log(typeof hello()); // undefined function getNumber() { return 123; } console.log(typeof getNumber); // function console.log(typeof getNumber()); // number // function expression const a = function () { console.log('A'); }; const b = function..
class // class class Fruit { // Constructor: A function called when an object is created with the 'new' keyword. constructor(name, emoji) { this.name = name; this.emoji = emoji; } display = () => { console.log(`${this.name}: ${this.emoji}`); }; } // apple is an instance of the Fruit class. const apple = new Fruit('apple', '🍎'); class User { constructor(first, last) { this.firstName = first; this..