2021/08/04 수요일 Chapter 7 : 3-3일차
오늘은 학습방법을 다시 돌아보는 시간을 가졌다.
시간을 조금 더 유용하게 쓰고 싶어서 생각을 많이 했다.
오늘 배운 것
const myArray = [1,2,3,4,5,6,7,8,9,0];
const newResult = [];
// 10개까지는 필요없어서 저 중에 4개만 뽑고싶어용
while (newResult.length < 4) {
// 결과 배열에 4개 들어올 때 까지 반복
const poppedElement = myArray.splice(
Math.floor(Math.random() * myArray.length),
1)[0];
newResult.push(poppedCourse);
}
pm2 start npm --name "{app_name}" -- run {script_name}
pm2 start npm -- run start:dev
상수는 constants 파일을 하나 만들어서 집어넣으면 된다.
@IsIn()과 상수의 조합..☺
API의 건수가 제한되어 있을 때에는 신중하게 쓰자. 괜히 절반 날려먹었다.