방구석 개발자의 놀이터

  • 홈
  • 태그
  • 방명록

불변객체 1

[React] 불변객체로 변수 비교의 장점

결론적으로 변수를 불변객체로 관리하면 나중에 두개의 변수를 비교할 때 편리하다. 이 말을 밑에 예시 코드로 확인해보자. const animal1 = { animal: [ {name: "dog", age: 10}, {name: "cat", age: 20} ] } const animal2 = { animal: [ {name: "dog", age: 10}, {name: "cat", age: 18} ] } 위의 animal1 과 animal2를 비교한다고 해보자. 만약 불변성을 유지하지 않은채로 변수를 관리 한다면 1. animal1.animal.length === animal2.animal.length 2. animal1.animal[0] === animal2.animal[0] 3. animal1.animal..

Front-End/React 2022.01.26
이전
1
다음
더보기
프로필사진

게으른 사람들에게 편리함을 제공해 줄 수 있을 때 가장 기쁜 개발자

250x250
  • 분류 전체보기 (102)
    • JAVA (2)
    • Spring (17)
    • Python (14)
    • 회고록 (4)
    • Flutter (3)
    • Git (1)
    • Spring Boot (15)
    • Algorithm (3)
    • AWS (1)
    • Front-End (34)
      • HTML (1)
      • CSS (1)
      • SCSS (2)
      • JavaScript (12)
      • React (13)
      • React-query (1)
      • NextJS (0)
      • Test (1)
    • OpenSource (3)
    • 독서 (0)
    • 강의 (1)
    • Error (4)

Tag

react-router-dom, frontend, flutter, PYTHON, spring, 회고록, lombok, javascript, 프론트엔드, front-end, springframework, springboot, opensource, 개발자, es6, aspect, component, CSS, spring boot, react,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

«   2025/05   »
일 월 화 수 목 금 토
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 31

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

티스토리툴바