-
Notifications
You must be signed in to change notification settings - Fork 9
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
[Lily] 4-4w #40
base: Lily
Are you sure you want to change the base?
[Lily] 4-4w #40
Conversation
|
||
for (let j = 0; j < words.length; j++) { | ||
if (word === words[j]) { | ||
answer += j |
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.
객체로 키, 값을 주는것만 생각하고 배열로 간단하게 인덱스 값으로 해당 words의 숫자를 주는 생각을 못했네요. 하드코딩 적어지고 심플하고 좋네요!
let arr = answer.split(numbers[i]) | ||
answer = arr.join(i) |
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.
와... 배열 메서드 활용 짱이네요.. join은 진짜 생각도 못했네
|
||
for (let i = 0; i <= t.length - len; i++) { | ||
const numbers = t.slice(i, i + p.length) | ||
if (+numbers <= +p) { |
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.
헉 Number 타입으로 바꿔주는 디테일 배워갑니다!!!
No description provided.