일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 비관적락
- querydsl
- FetchType
- 힙
- eager
- 다대다
- 스토어드 프로시저
- 유니크제약조건
- 일대다
- PS
- SQL프로그래밍
- 스프링 폼
- 이진탐색
- shared lock
- 연결리스트
- 낙관적락
- 백트래킹
- 지연로딩
- fetch
- JPQL
- 데코레이터
- exclusive lock
- 즉시로딩
- 동적sql
- 다대일
- execute
- 연관관계
- dfs
- CHECK OPTION
- BOJ
- Today
- Total
목록Javascript (26)
흰 스타렉스에서 내가 내리지

평화롭게 프로젝트 중.... 작성자를 띄우고 싶다..! 하지만 post 에는 UserId만 있을 뿐 username은 들어있지 않았는데, 가장 먼저 생각한 것은 posts에 forEach로 접근하여 각각의 post마다 username 정보를 불러와서 덧붙여주는 것. const posts = await Post.findAll({ where: { BoardId: currentBoard.id }, order: [["createdAt", "DESC"]], raw: true, }); posts.forEach(async (post) => { const author = await User.findOne({ where: { id: post.UserId } }); Object.assign(post, { author: a..

가장 나중에 나온 것이 이긴다! 다 덮어씌워버린다. obj 를 출력해보면 앞에껀 표기되지도 않는 걸 확인할 수 있다.

객체 안에 수많은 키밸류 쌍이 있더라도, 9번 줄처럼 우리가 원하는 변수만 저렇게 써주면 똭 할당됩니다...

1. Date.now().toString() 이거는 고유한 어떤 id를 생성해줄 때 사용. 2. new Date().toString() 이거는 게시글 객체에 작성날짜 기록할 때 사용.
다른사람의 JavaScript 코드에서 !! 를 보고 저게 무슨 효과가 있는지 의문을 가졌을 수도 있다. 결론 : 변수를 boolean type으로 바꾸는 가장 간단한 방법이다 JavaScript는 static language가 아니고 dynamic language이다. 이 말은 변수는 어느 type이든 참조하거나 가질수 있고, 그 type은 어느 지점에서든 바뀔 수 있다. JS에서 type은 대표적으로 아래와 같은 type이 있다. 물론 다른 것도 더 있음. Boolean String Number Object True 와 Truthy function() { var thisIsTrue = true; if (thisIsTrue) { window.alert('It certainly is!'); } } if문..

print 'nothing' in conole 이 버튼을 누르면, 콘솔에 nothing이 찍히게 하고 싶다. 만약 js파일에 코드가 이렇게 짜여져 있다면, class Nothing { constructor() { this.nothing = document.querySelector("button"); this.nothing.addEventListener("click", this.callPrintNothing);// this.callPrintNothing());// ***수정*** } printNothing() { console.log("nothing"); } callPrintNothing() { this.printNothing(); } } const nothing = new Nothing(); 콜백으로 전..
보호되어 있는 글입니다.
보호되어 있는 글입니다.
보호되어 있는 글입니다.
보호되어 있는 글입니다.