function basicFuntion() {
console.log("hello wolrd");
}
function basicFuntion() {
console.log("hello wolrd");
}
const variableFunction2 = () => {
console.log("hello wolrd");
}
const returnFunction = () => {
console.log(makeString());
}
const makeString = () => {
return "hello javascript";
}
const paramFunciont1 = (a, b) => {
console.log(`a + b = ${a + b}`);
}
const paramFunciont2 = (name = "hong") => {
console.log(`name = ${name}`);
}
const paramFunciont3 = (arr) => {
console.log(`arr = ${arr}`);
}
const exceptionFunction = () => {
try {
example();
} catch (e) {
alert(`error log : ${e}`);
console.log(`error log : ${e}`);
}
console.log("hello wolrd");
}
const arrFunction = () => {
const arr = [1, 2, () => { console.log("hello"); }];
arr[2]();
}
const createPerson = (name, email, age) => {
return {
name,
email,
age,
printPerson: () => { return `이름은 ${name}, 이메일은 ${email}, 나이는 ${age}` }
};
}
const objFunction = () => {
const p1 = createPerson("hong", "hong@naver.com", 30);
console.log(p1);
console.log(p1.printPerson());
}
alert();window.location.reload();window.location.href = "이동경로URL";사용자가 html 화면 내에서 특정행위(event)를 했을 때 자동 실행되는 함수
window.addEventListener('scroll', () => console.log("hello"));element.addEventListener('click', () => console.log("hello"));스크롤 이벤트 버튼 클릭 후 스크롤 시 출력 실행
클릭 이벤트 버튼 클릭 후 콘솔버튼 클릭 시 출력 실행