Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- nextjs
- react env
- styled components
- API token
- nextjs 설치
- createGlobalStyle
- CSS
- ngrok실행
- dart 변수
- ngrok설치
- getModifierState
- input type=file
- bootstrap
- rewrites
- API 토큰
- next.js css
- npm styled-reset
- There isn’t anything to compare
- SCSS
- nextjs .env
- fetch
- github io
- 컨디셔널 렌더링
- react typescript
- Git
- icon
- react
- github
- typescript react
- git lab
Archives
- Today
- Total
꾸준히 성장하는 개발자
[JavaScript] 배열에 숫자, 알파벳 등 담아내기 본문
숫자 배열로 담아내기
const arr = Array.from(Array(100), (_, i) => i + 1);
100개를 넣어주는 배열이다
console.log(arr)로 찍어보기
아스키코드를 이용하여 문자를 배열로 담아내기
String.fromCharCode( ) : 아스키코드번호를 받아 문자열을 구성해주는 함수
대문자 알파벳 배열로 담아내기
const arr = Array.from({ length: 26 }, (v, i) => String.fromCharCode(i + 65));
console.log(arr)로 찍어보기
소문자 알파벳 배열로 담아내기
const arr = Array.from({ length: 26 }, (v, i) => String.fromCharCode(i + 97));
'JavaScript' 카테고리의 다른 글
[JavaScript] cookie (0) | 2022.06.23 |
---|---|
[JavaScript] Promise/ fetch / then / catch / async await (1) | 2022.06.09 |
[라이브러리] chart.js (0) | 2022.05.18 |
[라이브러리] moment cdn, npm (0) | 2022.05.17 |
[JavaScript] json 파일 받아오기 (0) | 2022.05.12 |