일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- range
- and
- 위코드
- enumerate
- js
- 파이썬
- If
- WECODE
- iNT
- split
- Sorted
- decorator
- map
- DART
- Algorithm
- LOWER
- lambda
- STR
- count
- FOR
- SQL
- list
- len
- slice
- or
- sum
- index
- Python
- join
- MAX
- Today
- Total
목록js (25)
코드로 우주평화
Can you find the needle in the haystack? Write a function findNeedle() that takes an array full of junk but containing one "needle" After your function finds the needle it should return a message (as a string) that says: "found the needle at position " plus the index it found the needle, so: Example(Input --> Output) ["hay", "junk", "hay", "hay", "moreJunk", "needle", "randomJunk"] --> "found th..
Inspired by the development team at Vooza, write the function that accepts the name of a programmer, and returns the number of lightsabers owned by that person. The only person who owns lightsabers is Zach, by the way. He owns 18, which is an awesome number of lightsabers. Anyone else owns 0. Note: your function should have a default parameter. For example(Input --> Output): "anyone else" --> 0 ..
Description: Remove all exclamation marks from sentence but ensure a exclamation mark at the end of string. For a beginner kata, you can assume that the input data is always a non empty string, no need to verify it. Examples remove("Hi!") === "Hi!" remove("Hi!!!") === "Hi!" remove("!Hi") === "Hi!" remove("!Hi!") === "Hi!" remove("Hi! Hi!") === "Hi Hi!" remove("Hi") === "Hi!" Solution: const remo..
Given an array of numbers, check if any of the numbers are the character codes for lower case vowels (a, e, i, o, u). If they are, change the array value to a string of that vowel. Return the resulting array. Solution: function isVow(a){ for (let index in a) { let vow = String.fromCharCode(a[index]) if (["a", "e", "i", "o", "u"].includes(vow)) { a[index] = vow } } return a } const isVow = a => a..
Write a method that takes one argument as name and then greets that name, capitalized and ends with an exclamation point. Example: "riley" --> "Hello Riley!" "JACK" --> "Hello Jack!" Solution: var greet = function(name) { modifiedName = name.charAt(0).toUpperCase() + name.slice(1).toLowerCase() return `Hello ${modifiedName}!` }; var greet = function(name) { return 'Hello ' + name[0].toUpperCase(..
Description: A square of squares You like building blocks. You especially like building blocks that are squares. And what you even like more, is to arrange them into a square of square building blocks! However, sometimes, you can't arrange them into a square. Instead, you end up with an ordinary rectangle! Those blasted things! If you just had a way to know, whether you're currently working in v..
Description: Count the number of divisors of a positive integer n. Random tests go up to n = 500000. Examples (input --> output) 4 --> 3 (1, 2, 4) 5 --> 2 (1, 5) 12 --> 6 (1, 2, 3, 4, 6, 12) 30 --> 8 (1, 2, 3, 5, 6, 10, 15, 30) Solution: 1. Repeat 'n' to generate numbers one after the other. 2. Check whether the generated numbers are divisible by 'n'. 3. Count the number of divisible numbers. fu..
오늘 한 것 외부API를 이용해 최신 뉴스를 검색, 조회 하는 서비스를 만들었다. 레포 링크 : https://github.com/Daco2020/DACO-TIMES 서비스 링크 : https://daco-times.netlify.app/ 성장한 점 API로 fetch를 보내 받아온 응답을 가공할 수 있게 되었다. 가공한 데이터를 HTML로 바꾸어 브라우저에 보여주는 방법을 알게되었다. 노력할 점 아직 익숙하지 않으므로 관련된 프로젝트를 재차 진행하자. 프론트부터 백엔드, 데이터베이스까지 내가 직접 만드는 프로젝트를 해보자. 내일 하고 싶은 것 목요일날 기업과제가 생겨서 이에 대해 준비 할 예정이다.
오늘 한 것 js 강의 들으면서 블로그 포스팅을 하였다. js 로 외부API로 fetch를 해보았다. 성장한 점 forEach와 map, 화살표 함수에 대해 알게되었다. 직접 서버로 fetch를 할 수 있게 되었다. 이제 내 백엔드 서버와 연결할 수 있는 것이다! 노력할 점 js는 파이썬보다 문법이 더 다양하고 상세하다. 아직 배워야할 개념들이 많다. fetch를 해왔으니 json 데이터를 어떻게 가공하여 브라우저에 뿌려줄 수 있는지 궁금하다. 내일 하고 싶은 것 news API를 이용해 최신 뉴스 서비스를 구현하고 싶다. node.js로 서버를 열어보고 싶다.
배열을 받아 for문을 돌려 배열내 요소들을 찾거나 가공해야하는 경우가 많습니다. (매우매우) 파이썬이야 ' for i in arr: print(i) ' 로 끝나지만 js의 경우 for문내 조건에만 3가지 항목을 넣어야 합니다. // 일반적인 for 문 형태 for (let i = 0; i {console.log(item)} ) // 결과 1 2 3 4 // 두번째 인자를 지정하면 인덱스도 가져올 수 있다...