-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Add] 1주차 과제 제출 #2
Conversation
// 증감 연산을 왼쪽에 붙이냐, 오른쪽에 붙이냐에 따라 값이 달라짐. | ||
// 이 부분 모르겠으니까 집가서 다시봐라.. | ||
let a = 2; | ||
// let b = a++; // -> 이렇게 하면 b가 2가 나옴 | ||
let b = ++a; // -> 이렇게 하면 b가 3이 나옴 | ||
|
||
console.log(b); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let b = a++; 가 2인 이유는
대입 연산을 먼저 진행한 후에 후치연산인 ++를 진행해서 그렇답니다!
그러니께 78번을 지나면 b는 2가 되고 a는 3이 되겠죠,,
반대로 79번은 대입 연산을 하기 전에 ++를 해줘서 a를 먼저 증가 시킨 후에 대입을 하는거죠,,
그니간 79번을 지나면 a와 b 모두 3이 되는거랍니다!! ㅋㅋ
ㅋㅋㅋㅋ
// 여기서부터는 scope 연습 | ||
|
||
// if (true) { | ||
// var x = 'var variable'; | ||
|
||
// } | ||
|
||
// console.log(x); | ||
|
||
// if (true) { | ||
// const y = 'const variable'; | ||
// } | ||
|
||
// console.log(y); // 여기서 에러가 난다. 이유는 const는 블록 스코프니까. | ||
|
||
|
||
// var 변수는 function 스코프인데 가능할까? | ||
|
||
|
||
function foo() { | ||
if (true) { | ||
var name = '채정아'; | ||
console.log('if-block', name); | ||
} | ||
console.log('function-block-', name); // 여기서 var이 호출된 거는 상관없음 | ||
} | ||
|
||
console.log('global-', name); // 여기서 에러가 남 -> 함수 내부에서 선언이 되어 있기 때문에 | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
스코프가 헷갈리신다면,,,,,,
제가 자료를 보내드리죠...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
진짜 스승님이신가요?
console.log(sopt.group); | ||
sopt.introduce(); | ||
console.log(sopt.season); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
왜 빈줄이 두개죠?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
제성합니당..^^
object.js
Outdated
return `오늘 메뉴는 ${dinner}입니다.`; | ||
} | ||
|
||
const string2 = menu2('곱창'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
곱창은 좀.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
반영하겠습니다^^
// console.log(name3) // 임원진안짱 출력 | ||
|
||
// const name4 = "김루희짱"; | ||
// name4 = "김혜수"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
하잉 ㅋㅋ
var name = '채정아'; | ||
console.log('if-block', name); | ||
} | ||
console.log('function-block-', name); // 여기서 var이 호출된 거는 상관없음 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print("function-block-\(name)")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hyesuuou 굉장히 킹받지만, 역시 간결해서 좋은 것 같습니다. ^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다~!
// 1. as : 짱정아가 사용하는 방법! 나도 이거 써야징 | ||
|
||
let yourName: any = '채리지아'; | ||
let yourNameLength: number = (yourName as string).length; // 스위프트의 타입캐스팅임 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저도 짱정아님 방식 채택~!
return `오늘 메뉴는 ${dinner}입니다.`; | ||
} | ||
|
||
const string2 = menu2('혜수가 싫어하는 곱창'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hyesuuou 쨔잔~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저도 싫어해여
{ | ||
name: '조우찬', | ||
age: 3650, | ||
group: 'ob', | ||
mbti: ['istp', 'iOS 최고지'] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oownahcohc 마음에 드시나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
age가 좀 있는 편이네요??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
세미나 열심히들으셨군요'^'
간간이 있는 주석 혼잣말이 넘나 킹받아요ㅋㅋ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧑🏻🎤 LGTM
// 비교연산자 | ||
if (A === x) { | ||
console.log('A===5, 값과 타입도 같음'); | ||
} | ||
|
||
if (A === y) { | ||
console.log('A===문자열5, 값과 타입도 같음'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
=== 은 swift에는 없나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵 있습니다! 그런데 소연님 왜 물어보시져? 아시잖아여.
random.ts
Outdated
interface Members { | ||
name: String; | ||
group: String; | ||
} | ||
|
||
// 기억하기! : interface에는 함수가 들어갈 수 있음 | ||
interface Dinner { | ||
member: Members[]; | ||
shuffle(member: Members[]): Members[]; | ||
organize(member: Members[]): void; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
인터페이스 모듈화 부탁드려요 불 - 편 합니다 ㅋㅋㅋㅋㅋ
random.ts
Outdated
const ob = array.filter((array) => array.group === "ob"); | ||
const yb = array.filter((array) => array.group === "yb"); | ||
|
||
let dinnerMember: String[] = [ob[0].name, yb[0].name]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filter를 사용하셔서 인덱스로 접근을 해야 하는게 살짝 아쉽네요.
find에 대해서 알아보시는 건 어떨까요? ㅎㅎㅎㅎ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
리팩토링 수고요
random.ts
Outdated
interface Members { | ||
name: String; | ||
group: String; | ||
} | ||
|
||
// 기억하기! : interface에는 함수가 들어갈 수 있음 | ||
interface Dinner { | ||
member: Members[]; | ||
shuffle(member: Members[]): Members[]; | ||
organize(member: Members[]): void; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
인터페이스 모듈화 ㅋㅋ갈겨
random.ts
Outdated
const ob = array.filter((array) => array.group === "ob"); | ||
const yb = array.filter((array) => array.group === "yb"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
find도 써보셈ㅋㅋ
{ | ||
name: "남준표", | ||
group: "ob", | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
나자나~?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
한번더~!
random.ts
Outdated
const ob = array.find((array) => array.group === "ob") as Members; | ||
const yb = array.find((array) => array.group === "yb") as Members; | ||
|
||
let dinnerMember: String[] = [ob.name as String, yb.name]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ob는 타입단언 해줬는데 왜 yb는 안해줬죠? 와이비 차별하시나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
사실 안하는게 맞을걸??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ㅋㅋㅋㅋㅋㅋㅋ아 제발ㅋ 지웟어 어서 approved 눌러종
random.ts
Outdated
|
||
let dinnerMember: String[] = [ob[0].name, yb[0].name]; | ||
let dinnerMember: String[] = [ob.name as String, yb.name]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yb 는 왜 안해줘요??? 다시~~~!!!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
진짜 개킹받네여;;ㅋ ㅈㅅㅈㅅ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
하세요 머지~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
참 잘했어요 도장 쾅!
name: '김후릐', | ||
age: 98, | ||
group: 'yb', | ||
mbti: ['ISFP', 'iOS'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mbti가 iOS이세여?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CatchMe 라고 바꿀래영...
return `오늘 메뉴는 ${dinner}입니다.`; | ||
} | ||
|
||
const string2 = menu2('혜수가 싫어하는 곱창'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저도 싫어해여
📌 관련 이슈
#1
📌 PR Point