목록JavaScript (34)
Frontend 개발자 - hyo.loui
❤️🔥TIL : Today I Learned 배열 메서드 forEach() map() filter() reduce() forEach() 오직 Array 배열에서만 사용 가능한 메서드 (ES6부터는 Map, Set 등에서도 지원) forEach 구문의 인자로 callback 함수를 등록할 수 있으며, 배열의 각 요소들이 반복될 때 callback 함수가 호출 callback 함수에서 배열 요소의 인덱스와 값에 접근가능 (아래 코드에서는 item 에 해당) array의 길이(length)가 5라면 1, 2, 3, 4, 5 까지 순서대로, 하나씩 접근하여 반환 const items = ['사과', '바나나', '복숭아']; items.forEach(function(item) { console.log(item..
❤️🔥TIL : Today I Learned 명시적 this 바인딩 상황에 따라 달라지는 this 메서드 내부 함수에서 this 우회 명시적 this 바인딩 상황에 따라 달라지는 this this는 실행 컨텍스트가 생성될 때 결정(this binding) === this는 함수를 호출할 때 결정하며 전역 공간에서 this === window // 전역 공간에서의 this console.log(this); console.log(window); console.log(this === window); //true 함수 호출시 this === window ex) function(); // 함수와 메서드 호출시 각각 this 는 각각 다르게 할당 var func = function (x) { console.log..
❤️🔥TIL : Today I Learned 실행 컨텍스트 실행 컨텍스트란? VariablEnvironment 와 LexicalEnvironment [ VE, LE ] LexicalEnvironment(1) - EnvironmentRecord(= record)와 호이스팅 OuterEnvironmentReference(= outer) 실행 컨텍스트란 실행할 코드에 환경 정보를 제공하는 객체이다! 실행컨텍스트를 모아 콜스택에서 처리하게 된다! 콜스택에서는 가장 위에 쌓인 컨텍스트와 관련된 코드를 실행하는 방법이며, 코드의 환경 및 순서를 보장한다 컨텍스트 구성 방법 전역 공간 > eval( ) 함수 > 함수(우리가 실행컨텍스트를 구성하는 방법) 컨텍스트 구성 예시 // ---- 1번 var a = 1; f..
❤️🔥TIL : Today I Learned 데이터 타입 데이터 타입의 종류 데이터 할당 기본형 데이터와 참조형 데이터 불변객체 - 얕은 복사, 깊은 복사 undefined 와 null 데이터 타입의 종류 (이미지 출처 : https://velog.io/@imjkim49/자바스크립트-데이터-타입-정리) 기본형과 참조형의 구분 기준 복제의 방식 기본형(Primitive type) : 값이 담긴 주소값을 복제 참조형(Reference type) : 주소값들의 묶음을 가리키는 주소값을 복제 불변의 여부 : 기본형은 불변형이며, 참조형은 가변형이다! 식별자, 변수 let abc = 10; 식별자 - 위에서 선언한 abc 라는 변수명 변수 - abc라는 변수명에 할당한 10 이라는 숫자 데이터 데이터 할당 //..
더보기 ❤️🔥TIL : Today I Learned try...catch 개발을 하다보면 누구나 에러를 만나고, 또 누구라도 에러가 생기기 마련이다. 이러한 에러로 인해 다른 구문이 실행이 안되는 상황이생겨, 렌더링을 마무리하지 못하게 된다. if/else 문을 통해 예외 처리를 할 수 있지만 모든 개발자가 수많은 에러를 예측하기 쉽지는 않다. 그래서 우리는 try...catch 를 통해 코드가 중단되는 것을 방지하고 에러의 예외처리를 해놓는다면, 더 안정적인 코드를 작성할 수 있다 try(시도) 하여 에러가 발생하면 try(잡는) 문법 이다. try{ //실행될 코드 } catch (error) { //에러 발생 시 실행할 코드 } 그래서 if/else 를 사용하는 것 처럼 try 와 catch 라는..
❤️🔥TIL : Today I Learned forEach() 배열을 순회하며, 인자로 전달한 함수를 호출하는 반복문이다. 배열, Set, Map 에서 사용 가능하다 forEach() 문법 배열 순회 배열 순회 - Lambda 식 value, index 인자로 받기 value, index, array 인자로 받기 Set 에서 forEach()로 요소 순회하기 Map 에서 forEach()로 요소 순회하기 forEach() 문법 arr.forEach(func(value, index, array)) value : 현재 돌고있는 데이터 index : 현제 돌고있는 데이터중 index array : 배열중 하나 result = cal(b=2, a=1) : 매개변수 호출 시 매개변수명을 지정해서 대입한다면 순서..
S.A (Starting Assignments) 💾 Project : 팬PicK 제목 ✔ 와이어프레임 ✔ 기능 분류 ✔ 📝 첫 번째 회의 내용 프로젝트 서비스 키워드 : 스터디(채팅) 새상품(거래) 사이드프로젝트(매칭) 반려동물(커뮤니티) 챌린저스(매칭) 🚩팬(커뮤니티) * 투표하여 선정 제목 프로젝트 네임 : 홍보팬 팬결고리 🚩팬Pick - fix * 투표하여 선정 💡 참조 레퍼런스 #팬픽 : 스타와 팬이 함께하는 공간 #팬픽 : 스타와 팬이 함께하는 공간 shopfanpick.com Disquiet* Disquiet* IT 서비스 메이커들의 소셜 네트워크. 디스콰이엇에서 서로의 프로젝트를 공유해 보세요! disquiet.io velog velog 디자인 저작권 문제로 디자인은 올릴 수 없지만 내가 보..
❤️🔥WIL: Weekly I Learned 이번주 한 일 티스토리 블로그(기술 블로그) 개설 = 매일 TIL 일지 JavaScript 문법 기초 KDT 실무형 프론트엔드 엔지니어 = 강의 완주 파이썬 문법 기초 KDT 실무형 프론트엔드 엔지니어 양성과정 = 강의 완주 자료구조, 알고리즘 KDT 실무형 프론트엔드 엔지니어 = 청취중 깃허브 repository 생성 + 초대 react A반 10조(부드라미조) 조장으로써 한일 study review 2주차는 본격적인 강의 커리큘럼이 시작되었다 자바스크립트는 다른 강의들로 선학습을 해놓은 터라 수월하게 강의를 들을 수 있었다. 파이썬은 너무 생소해서 무의식적으로 어렵겠다 라는 생각을 갖고 공부를 시작했지만, 그래도 자바스크립트로 어느정도 프로그래밍 문법에 ..