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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
week09/node_modules
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
# Web
🕸 UMC 2기 Web 스터디
16 changes: 16 additions & 0 deletions week03/01_변수,자료형,연산자/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="./index.js"></script>
</head>

<body>

</body>

</html>
75 changes: 75 additions & 0 deletions week03/01_변수,자료형,연산자/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// 변수 : 선언. 초기화. 재할당

const 변수1 = "코딩";
let 변수2 = "자바스립트";

// 변수1 = '코딩은 어려워';
변수2 = "html";

// ====================================

// 데이터 타입, 자료형 :
// 1. string : 문자열

const str = "안녕";
const str2 = "hi";
const num = "2!!";

// 2.number : 숫자
const number = 2;

// 3. bigInt : 큰값이 숫자

// 4. boolean : true, false
const bool = true;
const bool1 = false;

// 5. symbol : 중복되지 않는 고유값

// 6-7. null / undefined

const a = undefined;
const b = null;

let variable;
console.log(variable);

// 8. object : 객체 - 함수, 배열, 객체

// ====================================

// 1. 산술연산자 : +, - , /, *, %, **, ++, --

const aa = 10 % 3;
console.log(aa);

const bb = 10 ** 2;
console.log(bb);

let cc = 5;
cc += 10; // cc = cc + 10
console.log(cc);

cc -= 8; // cc = cc - 8;
console.log(cc);

// 2. 할당 연산자 : =

// 3. 문자열 연산자 : + , +=
let data = "happy" + " " + "2022";
console.log(data);

data += "!!"; //data = data + '!!'
console.log(data);

// 비교 연산자 :
// 1. == : 대충 비교
// 2. === : 엄격하게 비교
// 3. != : 대충 비교
// 4. !== : 엄격하게 비교
// 5. 부등호 : > , <, >= , <=

//논리연산자 : &&, ||, !
// && : 조건 중 하나라도 false가 되면 => false
// || : 두개의 조건이 모두 false여야지 => false
// ! : 반대
16 changes: 16 additions & 0 deletions week03/02_배열/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="./index.js"></script>
</head>

<body>

</body>

</html>
45 changes: 45 additions & 0 deletions week03/02_배열/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// 배열
// 1. 선언 : [], new Array(), 빈배얄에 index 이용해서 하나씩 추가
// const travel_spot = ['방콕', '뉴욕', '파리'];
// const travel_spot = new Array('방콕', '뉴욕', '파리');
// console.log(travel_spot);
const travel_spot = new Array();
travel_spot[0] = "방콕";
travel_spot[1] = "뉴욕";
travel_spot[2] = "파리";

// 2. 접근 : index
const paris = travel_spot[2];
console.log(paris);

// 3. 추가 및 삭제

// travel_spot = ['토론토', '멜버른', '바르셀로나', '아테네']; //재할당 불가

// push : 뒤에 원소 추가
travel_spot.push("토론토", "퀘백");
console.log(travel_spot);

// unshift : 앞에 원소 추가
travel_spot.unshift("바르셀로나");
console.log(travel_spot);

// splice : 원하는 지점에 추가 및 삭제
// -> splice(시작 index, 삭제하고 싶은 원소의 개수, 추가하고 싶은 원소들)
travel_spot.splice(4, 0, "멜버른", "아테네");
console.log(travel_spot);

// pop : 뒤에서 원소 삭제
const result = travel_spot.pop();
console.log(travel_spot, result);

// shift : 앞에서 원소 삭제
const result1 = travel_spot.shift();
console.log(travel_spot, result1);

// splice
const result2 = travel_spot.splice(3, 3);
console.log(travel_spot, result2);

travel_spot.splice(1, 1, "이스탄불", "하노이");
console.log(travel_spot);
16 changes: 16 additions & 0 deletions week03/03_객체/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="./index.js"></script>
</head>

<body>

</body>

</html>
90 changes: 90 additions & 0 deletions week03/03_객체/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
// const pooh = ['pooh', 'bear', 'disney character', 'boy'];
// 1. 객체 선언
const pooh = {
name: "pooh",
species: "bear",
job: "disney character",
gender: "boy",
"say-Hi": function () {
console.log("I'm winnie the pooh, What's your name?");
},
};

// 2. 객체 접근 : ., []

// console.log(pooh['species']);
// console.log(pooh['say-Hi']());

// 3. 객체에 추가 및 삭제

pooh["say-Bye"] = function () {
console.log("I'm winnie the pooh, See you later");
};

// console.log(pooh);

pooh.favorites = ["honey", "friends", "cake"];

// console.log(pooh);

delete pooh.favorites;

// console.log(pooh);

// 생성자 함수 : 틀

function Character(name, species, job, gender) {
this.name = name;
this.species = species;
this.job = job;
this.gender = gender;
this["say-Hi"] = function () {
console.log(`I'm ${this.name}, What's your name?`);
};
this["say-Bye"] = function () {
console.log(`I'm ${this.name}, See you later`);
};
}

const winnie_the_pooh = new Character(
"winnie the pooh",
"bear",
"disney character",
"boy"
);

console.log(winnie_the_pooh);

console.log(winnie_the_pooh["say-Hi"]());

const snoopy = new Character("snoopy", "dog", "comic book character", "boy");

const pikachu = new Character(
"pikachu",
"squirrel",
"pokemon character",
"boy"
);

console.log(snoopy, pikachu);
console.log(snoopy["say-Bye"](), pikachu["say-Bye"]());

winnie_the_pooh.favorites = ["honey", "friends", "cake"];
console.log(winnie_the_pooh);

// const obj = new Object();
// console.log(obj)
// obj.name = 'dwell';
// obj.greeting = function(){
// console.log('hi')
// }

const arr = new Array();
const obj = new Object({
name: "dwell",
greeting: function () {
console.log("hi");
},
});

console.log(obj, arr);
16 changes: 16 additions & 0 deletions week03/04_함수/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<script src="./index.js"></script>
</head>

<body>

</body>

</html>
17 changes: 17 additions & 0 deletions week03/04_함수/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// function multiply10 (num) {
// const result = num * 10;
// return result;
// }

// const data = multiply10(10);
// console.log(data);

// const result = multiply10(10);

// =======================================
// arrow function :

const multiply10 = (num) => num * 10;

const data = multiply10(100);
console.log(data);
16 changes: 16 additions & 0 deletions week03/05_조건문/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="./index.js"></script>
</head>

<body>

</body>

</html>
Loading