Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions problem01/problem01.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@
* 모든 변수 선언 및 초기화가 올바르게 이루어지도록 수정해야 테스트를 통과할 수 있습니다.
*/
function manageVariables() {
a++; // 🚨
let a = 2;
b += 1; // 🚨
let b = 10;
let b = 20; // 🚨
const c = 100;
c = 200; // 🚨
let a = 1; // 초기값 설정
a++; // 1 증가

let b = 10; // 초기값 설정
b += 10; // 10 더하기

const c = 200; // 초기값 설정

return { a, b, c };
}
module.exports = manageVariables;
10 changes: 5 additions & 5 deletions problem02/problem02.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
*/
function calcNumbers(a, b) {
return {
sum: a - b, // 🚨
diff: a + b, // 🚨
product: a / b, // 🚨
quotient: a * b, // 🚨
remainder: a ** b, // 🚨
sum: a + b, // 덧셈
diff: a - b, // 뺄셈
product: a * b, // 곱셈
quotient: a / b, // 나눗셈
remainder: a % b, // 나머지 연산
};
}
module.exports = calcNumbers;
10 changes: 5 additions & 5 deletions problem03/problem03.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
*/
function compareOps(a, b) {
return {
looseEqual: a === b, // 🚨
strictEqual: a == b, // 🚨
notEqual: a != b, // 🚨
greater: a < b, // 🚨
less: a > b, // 🚨
looseEqual: a == b, // 느슨한 동등 비교
strictEqual: a === b, // 엄격 동등 비교
notEqual: a !== b, // 엄격 부등 비교
greater: a > b, // a가 b보다 큰 경우
less: a < b, // a가 b보다 작은 경우
};
}
module.exports = compareOps;
10 changes: 5 additions & 5 deletions problem04/problem04.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
*/
function logicOps(a, b) {
return {
andResult: a || b, // 🚨
orResult: a && b, // 🚨
notA: a, // 🚨
notB: b, // 🚨
ternary: a && b ? a : b, // 🚨
andResult: a && b, // AND 연산
orResult: a || b, // OR 연산
notA: !a, // NOT 연산 (a 반전)
notB: !b, // NOT 연산 (b 반전)
ternary: a ? a : b, // 삼항 연산: a가 참이면 a, 아니면 b
};
}
module.exports = logicOps;
10 changes: 5 additions & 5 deletions problem05/problem05.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ function inspectValues() {
let d = "hello"; // string

return {
typeofA: typeof b, // 🚨
typeofB: typeof d, // 🚨
typeofC: typeof a, // 🚨
typeofD: "null", // 🚨
checkNull: b === undefined, // 🚨
typeofA: typeof a, // a의 타입 검사
typeofB: typeof b, // b의 타입 검사
typeofC: typeof c, // c의 타입 검사
typeofD: typeof d, // d의 타입 검사
checkNull: b === null, // b가 null인지 확인
};
}
module.exports = inspectValues;
Loading