일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 랜덤번호
- JavaScript
- 구글맵스
- nodejs
- JS
- Hook
- RecyclerView
- React
- 랜덤넘버
- fragment
- stylesheet
- 스프링부트
- SpringBoot
- TypeScript
- array
- GoogleMaps
- 안드로이드
- Javscript
- TextView
- button
- 리액트
- Android
- scrollview
- 오버라이딩
- npm
- 코틀린
- Java
- 자바스크립트
- Linux
- Kotlin
- Today
- Total
목록JS (20)
타닥타닥 개발자의 일상
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/bli2j4/btsg0nL3P18/WXSqeZ3pgqYxdYLTkmypsk/img.png)
const weekdays = ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun']; const openingHours = { [weekdays[3]]: { open: 12, close: 22, }, [weekdays[4]]: { open: 11, close: 23, }, [weekdays[5]]: { open: 0, // Open 24 hours close: 24, }, }; 위와 같은 obejct가 있다고 하자. openingHours라는 object는 value가 또 obejct 로 구성된 복잡한 object다. 해당 오브젝트에서 원하는 key,value 값만 쏙쏙 뽑아서 쓰고 싶으면 어떻게 할까? 바로 property name, key, value를 이용하면 된..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/eLt36L/btsglOwzd2r/Kkg2ukoGik3DPxm7MhNwKk/img.png)
openinghours라는 object와 restaurnat라는 object가 각각 따로 존재한다고 가정하자. const openingHours = { thu: { open: 12, close: 22, }, fri: { open: 11, close: 23, }, sat: { open: 0, // Open 24 hours close: 24, }, }; const restaurant = { name: 'Classico Italiano', location: 'Via Angelo Tavanti 23, Firenze, Italy', categories: ['Italian', 'Pizzeria', 'Vegetarian', 'Organic'], starterMenu: ['Focaccia', 'Bruschetta', ..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/b23xBj/btsgex2hLMZ/CiZsZLLzhBfYjefTHA6lI1/img.png)
restuarnt라는 object에 있는 속성값에 있는 value들을 for 문을 이용해서 하나하나 출력하고 싶다고 하자. const restaurant = { starterMenu: ['Focaccia', 'Bruschetta', 'Garlic Bread', 'Caprese Salad'], mainMenu: ['Pizza', 'Pasta', 'Risotto'], } 그렇다면 menu라는 변수를 먼저 만든다. 그리고 spread연산자를 사용해 starterMenu 속성과 mainMenu 속성에 있는 값들을 모두 menu라는 변수에 집어넣는다. const menu = [...restaurant.starterMenu, ...restaurant.mainMenu]; 여기서 단순히 menu에 모두 들어간 값만 f..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/bT5MHX/btrXBY5jFiT/iErwKhE8jY33EEkxJXScLK/img.png)
주사위를 굴려 나온수를 합산, 주사위를 굴릴때 1이 나오면 자가 차례에서 합산된 수가 0이 되고 다른 선수에게 차례가 넘어감. 주사위가 1이 나오기 전에 나온 점수를 합산하고 다른 선수에게 넘기려면 hold를 누름. hold를 누를시 차기 차례에서 나온 주사위 수가 합산되며 다른 선수에게 차례가 돌아감. 그런식으로 게임을 해서 먼저 합해진 수가 100이 넘는 사람이 승리. index.html Player 1 43 Current 0 Player 2 24 Current 0 🔄 New game 🎲 Roll dice 📥 Hold style.css @import url('https://fonts.googleapis.com/css2?family=Nunito&display=swap'); * { margin: 0; p..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/sxSE0/btrWsUB3Sql/dqBKDtx0mtKSAPSkgieM7K/img.png)
JS와 연결된 HTML INDEX Show modal 1 Show modal 2 Show modal 3 //클래스 이름 옆에 hidden을 붙여 modal 클래스를 숨긴다. × I'm a modal window 😍 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in vol..
주어진 온도 배열을 다음과 같이 출력하는 함수 printForecast를 만들어라. prntForecast는 배열을 배개변수로 받고 예시 문장을 출력할수 있어야 한다. test data1: [17, 21, 23] test data2:[12, 5, -5, 0, 4] 예시 문장 [17, 21, 23] 배열은 다음과 같이 출력되어야 한다 "... 17ºC in 1 days ... 21ºC in 2 days ... 23ºC in 3 days ..." //테스트 데이터 배열 const data1 = [17, 21, 23]; const data2 = [12, 5, -5, 0, 4]; const printForecast = function (arr) { let str = ''; for (i = 0; i < arr.l..
문제) 가정용 온도계를 만드는 회사에 근무하고 있는 당신, 최근의 업무는 하루 동안의 온도를 배열로 만들고 amplitude를 계산하는 것이다. 기기 오작동이 날수도 있음을 참고하라. We work for a company building a smart home thermometer. Our most recent task is this: "Given an array of temperatures of one day, calculate the temperature amplitude. Keep in mind that sometimes there might be a sensor error" 하루 동안의 온도는 tmeperature이라는 변수에 배열로 저장되어 있다. 중간 기기 오작동으로 error가 포함되어 있..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/cciE6X/btrJEMcHKTc/A289eeRHmXHufuYpqLGDX0/img.png)
시작하기 전 설정 1. index.html 파일 생성 프로젝트 폴더에 자바스크립트 코드파일(variable.js) 외에도 브라우저의 콘솔창을 통해 결과를 출력하게 해주는 index.html 파일도 생성한다. index.html 2. Use srtict 입력하기 바닐라 자바스크립트 개발시 제일 먼저 'use strict'를 선언해주는 게 좋다. 자바 스크립트의 변수 Variable 1. let ES6에 추가된 변수로, ES6는 글로벌하게 개발자들이 이용하는 자바스크립트 문법이다. 이전에는 var라는 변수를 썼지만, var에는 치명적인 단점이 있다. 바로 var는 hoisting의 성격을 가지고 있기 때문이다. hoisting :move declaration from bottom to top 어디에 선언했냐..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/cn9rbq/btrupJoIuVu/fVon6tEEPFywVzG9iPS5JK/img.png)
기본적 세팅은 아래글 https://developerson.tistory.com/114 페이징은 아래글을 참고해서 만든 게시판이다. https://developerson.tistory.com/116 별도의 설명 없이 우선 코드만 백업할 예정. 이제 이걸 이해하는건 온전히 내 몫이다. 이해가 될때까지 계속 보는수 밖엔 없겠지 Spring Boot 스프링 부트를 이용한 백엔드 폴더 및 파일 구조 DatabaseConfig.java package mul.camp.a; import javax.sql.DataSource; import org.apache.ibatis.session.SqlSessionFactory; import org.mybatis.spring.SqlSessionFactoryBean; import ..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/bTNNSE/btrunOQuCJG/EK0T1ljHRaNDMpYhxKrWUK/img.png)
게시판에 글이 많이 늘어나면 한 페이지 안에서 많은 글을 보기 불편하다. 그래서 한 페이지당 글을 10개/20개 식으로 볼수 있도록 페이지를 나누곤 한다. 페이지당 볼수 있는 게시물을 나누는 행위를 페이징이라고 한다. https://github.com/josecebe/twbs-pagination GitHub - josecebe/twbs-pagination: jQuery pagination plugin (bootstrap powered) jQuery pagination plugin (bootstrap powered). Contribute to josecebe/twbs-pagination development by creating an account on GitHub. github.com 상기의 깃허브를 들..