Push
![[Javascript] const 변수 push(), pop()](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FX9Nqf%2FbtrzZM0GTvx%2FdVZbvJWrk9DTjhia13HHU0%2Fimg.jpg)
[Javascript] const 변수 push(), pop()
개발 중, 배열1에서 배열2로 각 요속들을 옮기는 코드에서 당연히 let으로 빈 배열을 선언했는데, eslint error가 났다. push하는 코드가 있는데 왜 경고가 나지? const는 값 변경이 불가능한 것 아니었나? 라는 생각이 들었다. 하지만, const로 선언하고 push(), pop()을 해도 잘 동작한다. 이유를 찾아보니, const는 선언과 동시에 할당이 이루어질 때 사용하는 것으로, 재할당이 불가능하다는 특징이 있는데 push(), pop()의 경우 배열을 다른 값으로 교체하는 것, 재할당하는 것이 아닌, 기존 배열 원본을 수정하는 것이므로 가능하다는 것이다. 배열은 포인터로 선언이 되어있는데, push, pop은 포인터를 바꾸는 것이 아닌 같은 포인터의 값만 변경시키는 것이다. +덧붙..
![[GitLab] error: 레퍼런스를 'https://gitlab.com/team/repository.git'에 푸시하는데 실패했습니다](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbjFL8l%2Fbtq4bteJSCe%2FjoScli1eMI5bvmGXA95yHk%2Fimg.png)
[GitLab] error: 레퍼런스를 'https://gitlab.com/team/repository.git'에 푸시하는데 실패했습니다
Gitlab 에서 Repository 처음 생성 후, 적혀있는대로 clone, commit, push를 진행하는데 push 단계에서 에러가 발생했다! 에러메세지 error: 레퍼런스를 'https://gitlab.com/team/repository.git'에 푸시하는데 실패했습니다 커밋된걸 보니 main branch로 commit 되었는데, 내가 따라친건 master로 되어있었다 master대신 main으로 push하니 성공 git push -u origin main