현재 열려있는 창 닫기 cmd + w
코드 한번에 접고 펼치기 cmd + shift + - / +
메소드 접고 펼치기 cmd + -/+
'잡다 > 유용한정보' 카테고리의 다른 글
데이터 직군 구별?! (1) | 2023.11.28 |
---|---|
구글 검색방법 (0) | 2023.11.14 |
현재 열려있는 창 닫기 cmd + w
코드 한번에 접고 펼치기 cmd + shift + - / +
메소드 접고 펼치기 cmd + -/+
데이터 직군 구별?! (1) | 2023.11.28 |
---|---|
구글 검색방법 (0) | 2023.11.14 |
사용할 제네릭(generic) 클래스의 기본 구조
Map<k,v>
type RoutineExerciseItemDto = {
exerciseName: string;
bodyPart: string;
};
type RoutineData = {
id: number;
name: string;
routine: RoutineExerciseItemDto[];
};
const expampleMap = new Map<number, RoutineData>();
routineMap.set(1, {
id: 101,
name: "Chest Day",
routine: [/* RoutineExerciseItemDto 객체들 */]
});
-> 1 이 key 가되고 {} 가 value 가 된다.
위의 exampleMap을 이용하여 파이썬의 딕션너리와 비슷하게 만들어보기
const routines = [
{
id: 101,
name: "Chest Day",
exercises: [
{ exerciseName: "Bench Press", bodyPart: "Chest" },
{ exerciseName: "Push-up", bodyPart: "Chest" },
],
},
{
id: 102,
name: "Leg Day",
exercises: [
{ exerciseName: "Squat", bodyPart: "Legs" },
{ exerciseName: "Lunge", bodyPart: "Legs" },
],
},
{
id: 103,
name: "Back Day",
exercises: [
{ exerciseName: "Deadlift", bodyPart: "Back" },
{ exerciseName: "Pull-up", bodyPart: "Back" },
],
}
];
// 루프를 이용한 Map 초기화
routines.forEach((routine, index) => {
routineMap.set(index + 1, {
id: routine.id,
name: routine.name,
stationary: routine.exercises,
});
});
각 key 에 해당하는 값 불러오기
routineMap.get(1);
// 반환 값
// {
// id: 101,
// name: "Chest Day",
// stationary: [...]
// }
[TS] index signature (0) | 2024.08.03 |
---|---|
[ TS ] DTO object 구현 (0) | 2024.08.03 |
[ TS ] 불변객체 immutable 장점 / 단점 / 구현방법 (0) | 2024.07.28 |
[ TS ] 비밀번호 암호화 (bcypt) (0) | 2024.06.13 |
[ TS ] tsconfig.json 의 내용 정리 (0) | 2024.06.08 |
array.every((element, index) => { return 조건; })
const numbers = [2, 4, 6];
const allEven = numbers.every((num) => num % 2 === 0); // true
→ 즉, 비교를 하려는 Array1 의 순서가 Array 2의 순서대로 정렬돼 있어야만 정확히 비교됨
const array1 = [1,2,3]
const array2 = [1,2,3]
const isSame =
array1.length === array2.length &&
array2.every((element, index) => element === array1[index]);
[ JS ] 프라미스와 async / await : async와 await (0) | 2024.06.05 |
---|---|
[ JS ] 프라미스와 async / await : 프라미스화 (0) | 2024.06.05 |
[ JS ] 프라미스와 async / await : 프라미스 API (0) | 2024.06.05 |
[ JS ] 프라미스와 async / await : 프라미스와 에러 핸들링 (0) | 2024.06.05 |
[ JS ] 프라미스와 async / await : 프라미스 체이닝 (0) | 2024.06.04 |
repository 를 생성해서 이름을 정할때 마다 고민이 되어서 통일성 있게 하기 위해 정리
prefix-[기술이름]-[옵션:추가 디테일 사항]
개인 프로젝트
[프로젝트명] - [backend/ frontend] - [기술 프레임(express, nestjs,...)]
(ex) gymlog-backend-nestjs, gymlog-be-nestjs
학습 기반 구현 프로젝트 - 실무 예제를 따라 하거나 튜토리얼 기반으로 만든 것
clone-[대상 서비스 명] -[be/ fe/ full]
[강의 업체] - [프로젝트 명] - [기술]-[be/ fe/ full]
[ GitHub] 현재 작업 중인 브랜치와 main/develop와 일치하지 않을 때 혹은 변경 사항이 생겼을 때 특정 파일만 가져오는 방법 (0) | 2025.05.14 |
---|---|
[ Git & GitHub ] 레포지토리를 clone한 뒤에, 원격에 있는 모든 브랜치를 가져오는 방법 (1) | 2024.09.20 |
[ git ] Pull Request 를 잘 못하고 close 한 경우 되돌리는 방법 (0) | 2024.06.11 |
[ git ] 커밋 메세지 컨벤션 (0) | 2024.06.09 |
[ git ] 브랜치 전략 정리 (0) | 2024.06.02 |
현재 브랜치에서
git fetch origin # 최신 원격 정보 가져오기
git show origin/develop:README.md > README.md # 특정 파일만 가져오기
git pull # 전체 변경사항을 로컬 브랜치에 병합
[ GitHub] 레포지토리 네이밍 방식 정리 (0) | 2025.05.15 |
---|---|
[ Git & GitHub ] 레포지토리를 clone한 뒤에, 원격에 있는 모든 브랜치를 가져오는 방법 (1) | 2024.09.20 |
[ git ] Pull Request 를 잘 못하고 close 한 경우 되돌리는 방법 (0) | 2024.06.11 |
[ git ] 커밋 메세지 컨벤션 (0) | 2024.06.09 |
[ git ] 브랜치 전략 정리 (0) | 2024.06.02 |