::Assignment::
콘솔창에 "I love WeCode!" 메세지가 출력되도록 해주세요.
기존에 있던 코드들은 모두 삭제하고 "I love WeCode!" 만 출력되도록 해주시면 됩니다.
console.log()
console.log('I love Wecode!');
::Assignment::
코드 에디터 마지막에 작성되어 있는
ignore()
함수가 실행될 수 있도록 주석을 풀어주세요.
/*
function ignore() {
return true;
}
ignore();
*/
function ignore() {
return true;
}
ignore();
// 한 줄 주석은 이렇게 슬래시 2개를 입력해주면 된다.
::Assignment::
index.js
에 variables 라는 함수가 있습니다.- 그 안에
myAge
라는 변수가 이미 선언되어 있습니다.yourAge
라는 변수를 새롭게 선언하고 나이를 할당해주세요.myAge
와yourAge
변수의 합이 50이 될 수 있도록yourAge
의 값을 정해주세요.
const
, let
function variables() {
const myAge = 21;
const yourAge = (50-myAge);
return myAge + yourAge;
}
function variables() {
const myAge = 21;
const yourAge = 29;
return myAge + yourAge;
}
변수 안에 50이 만들어지는 숫자를 그대로 넣어도 되고 내가 한 것처럼 연산자를 이용해서 값을 넣어도 된다.
::Assignment::
- 함수 이름은
checkYear
로 해주세요.- 올해 년도를
return
합니다.- 년도를 작성할 때는
""
(쌍따옴표)없이 숫자만 4자리 써주세요.
function checkYear() {
const thisYear = 2021;
return thisYear;
}
::Assignment::
- 함수 이름은
addTen
입니다.- 받은 parameter에 10을 더해서 반환(return)해주세요.
hint: return
function addTen(num) {
return num + 10;
}