Title: 무결성 제약 규칙 · Issue #10 · dev-oddments/algorithm · GitHub
Open Graph Title: 무결성 제약 규칙 · Issue #10 · dev-oddments/algorithm
X Title: 무결성 제약 규칙 · Issue #10 · dev-oddments/algorithm
Description: const 는 불변 변수를 정의할 때 사용한다. 그런데 나는 지금까지 push, splice, pop, shift 같은 가변 내장 함수를 사용하여 변경해왔다.
Open Graph Description: const 는 불변 변수를 정의할 때 사용한다. 그런데 나는 지금까지 push, splice, pop, shift 같은 가변 내장 함수를 사용하여 변경해왔다.
X Description: const 는 불변 변수를 정의할 때 사용한다. 그런데 나는 지금까지 push, splice, pop, shift 같은 가변 내장 함수를 사용하여 변경해왔다. <Do it! 리엑트 프로그래밍 정석> 책을 읽다보니 무결성 제약 규칙에 대해서 설명해주었다. 결론적으로 const로 정의한 객체나 배열은 가변 내장 함수로 수정할 수 있긴 하지만 이...
Opengraph URL: https://github.com/dev-oddments/algorithm/issues/10
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"무결성 제약 규칙","articleBody":"`const` 는 불변 변수를 정의할 때 사용한다. 그런데 나는 지금까지 `push`, `splice`, `pop`, `shift` 같은 가변 내장 함수를 사용하여 변경해왔다.\r\n\r\n\u003cDo it! 리엑트 프로그래밍 정석> 책을 읽다보니 무결성 제약 규칙에 대해서 설명해주었다. 결론적으로 `const`로 정의한 객체나 배열은 가변 내장 함수로 수정할 수 있긴 하지만 이런식으로 사용하는 것은 지양해야 한다.\r\n\r\n아래와 같이 무결성 내장 함수인 `concat` 및 `slice`를 조합하면 가변 내장 함수의 기능을 동일하게 수행하도록 할 수 있다. 이 과정에서 return 된 값을 새로운 불변 변수에 대입하는 식으로 무결성 제약 규칙을 지킬 수 있다. \r\n\r\n\u003cimg width=\"511\" alt=\"Screen Shot 2021-03-23 at 1 40 34 PM\" src=\"https://user-images.githubusercontent.com/16266103/112093745-5977f880-8bdd-11eb-8aed-4d7f24a650ee.png\">\r\n\r\n실무에서 일반적으로 무결성 제약 규칙을 사용하는지는 잘 모르겠다. 다만 저자의 회사(Aribnb)에서는 이렇게 사용하는 듯 하다. ","author":{"url":"https://github.com/voidmatcha","@type":"Person","name":"voidmatcha"},"datePublished":"2021-03-23T04:43:59Z","url":"https://github.com/dev-oddments/algorithm/issues/10"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d90219db-e207-4e55-d7b6-607d4b05239d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E0BE:24645:AF1729:E6CFFD:6B01BE5C |
| html-safe-nonce | 11d61a583380987e58a4fa1caec11dbdf53fa02ea2b8a4643da529822eb23406 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMEJFOjI0NjQ1OkFGMTcyOTpFNkNGRkQ6NkIwMUJFNUMiLCJ2aXNpdG9yX2lkIjoiMzAxNDE5Mzk4ODQwNTE0OTI3NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 309a8321d74fb22434e14aae42656d469ea2fe6f1c4d86376a6aec01e3c7e5ee |
| hovercard-subject-tag | issue:838343464 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/dev-oddments/algorithm/10/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ae6614f1cd9bed7607df05ecbd4d379c232f29531eccc3b71e468718a67fb4e2/dev-oddments/algorithm/issues/10 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ae6614f1cd9bed7607df05ecbd4d379c232f29531eccc3b71e468718a67fb4e2/dev-oddments/algorithm/issues/10 |
| og:image:alt | const 는 불변 변수를 정의할 때 사용한다. 그런데 나는 지금까지 push, splice, pop, shift 같은 가변 내장 함수를 사용하여 변경해왔다. |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | voidmatcha |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/dev-oddments/algorithm git https://github.com/dev-oddments/algorithm.git |
| octolytics-dimension-user_id | 64817883 |
| octolytics-dimension-user_login | dev-oddments |
| octolytics-dimension-repository_id | 330947840 |
| octolytics-dimension-repository_nwo | dev-oddments/algorithm |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 330947840 |
| octolytics-dimension-repository_network_root_nwo | dev-oddments/algorithm |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width