const array = ['a' , 1, 2, 'a' , 'a', 3]; // 1: 'Set' [...new Set(array)]; // 2: 'Filter' array.filter((item, index) => array.indexOf(item) === index); // 3: 'Reduce' array.reduce((unique, item) => unique.includes(item) ? unique : [...unique, item], []); // RESULT: // ['a', 1, 2, 3]

mysql installer를 눌러서 체크한부분으로 수정 아래 코드로 비밀번호를 바꾸거나 생성 후 FLUSH PRIVILEGES로 변경사항 즉시 변경 ALTER USER '[user]'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'; -- or CREATE USER '[user]'@'%' IDENTIFIED WITH mysql_native_password BY '[password]'; -- then FLUSH PRIVILEGES;
error message webpack : 이 시스템에서 스크립트를 실행할 수 없으므로 C:\Users\shimk\AppData\Roaming\npm\webpack.ps1 파일을 로드할 수 없습니다. 자세한 내용은 about_Execution_Policies(https://go.microsoft.com/fwlink/?LinkID=135170)를 참조 하십시오. 위치 줄:1 문자:1 + webpack + ~~~~~~~ + CategoryInfo : 보안 오류: (:) [], PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess 1. windows PowerShell 프로그램을 관리자 권한으로 실행합니다. 2. Get-ExecutionPolicy..
assing Object.assign() 메소드는 열거할 수 있는 하나 이상의 출처 객체로부터 대상 객체로 속성을 복사할 때 사용합니다. 대상 객체를 반환합니다. react, redux에서 자주 쓰입니다. const obj = { a: 1 }; const copy = Object.assign({}, obj); console.log(copy); // { a: 1 } const o1 = { a: 1, b: 1, c: 1 }; const o2 = { b: 2, c: 2 }; const o3 = { c: 3 }; const obj = Object.assign({}, o1, o2, o3); console.log(obj); // { a: 1, b: 2, c: 3 } concat concat() 메서드는 인자로 주어..
const { data: { data: { movies }, }, } = await axios.get("https://yts.mx/api/v2/list_movies.json"); console.log(movies); // const movies = await axios.get("https://yts.mx/api/v2/list_movies.json"); // console.log(movies.data.data.movies); 이런식으로 movies.data.data.movies라고 해야되는것을 조금 더 예쁘게? 가져올 수 있다 this.setState({ movies });
sort sort() 메서드는 배열의 요소를 적절한 위치에 정렬한 후 그 배열을 반환합니다. 정렬은 stable sort가 아닐 수 있습니다. 기본 정렬 순서는 문자열의 유니코드 코드 포인트를 따릅니다. 정렬 속도와 복잡도는 각 구현방식에 따라 다를 수 있습니다. const months = ['March', 'Jan', 'Feb', 'Dec']; months.sort(); console.log(months); // expected output: Array ["Dec", "Feb", "Jan", "March"] const array1 = [1, 30, 4, 21, 100000]; array1.sort(); console.log(array1); // expected output: Array [1, 10000..