일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- scrollview
- 구글맵스
- GoogleMaps
- button
- SpringBoot
- TextView
- JS
- stylesheet
- RecyclerView
- Linux
- 자바스크립트
- TypeScript
- array
- fragment
- 코틀린
- React
- npm
- nodejs
- JavaScript
- 안드로이드
- Java
- 랜덤번호
- Hook
- 스프링부트
- 리액트
- 랜덤넘버
- Android
- Javscript
- Kotlin
- 오버라이딩
- Today
- Total
목록JavaScript (21)
타닥타닥 개발자의 일상

array를 만들다보면 array 내부의 element들이 중복되는 경우가 있다. 만약 array 내에서 중복되는 값을 제외한 겹치지 않는 element들만 알고 싶거나, 중복되지 않는 고유한 element의 개수를 알고 싶다면, 이 중복 element 를 어떻게 처리해야 하나 멈칫 할 것이다. 그때는 Set를 이용하면 쉽게 배열의 중복값을 제거할 수 있으며 고유한 element 의 갯수를 알수 있다. 우선 Set이 어떤 것인지부터 알아보자. const ordersSet = new Set([ 'Pasta', 'Pizza', 'Pizza', 'Risotto', 'Pasta', 'Pizza', ]); 위와 같이 ordersSet라는 Set가 있다고 하자. 이 세트에는 Pizza와 Pasta라는 중복되는 요소..

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를 이용하면 된..

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', ..

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..

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..
문제) 가정용 온도계를 만드는 회사에 근무하고 있는 당신, 최근의 업무는 하루 동안의 온도를 배열로 만들고 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가 포함되어 있..
스티븐은 팁 계산기를 만들고 있다. 팁 계산기의 규칙은 아래와 같다. 계산서 가격이 50불에서 300불 사이이면 팁이 15% 적용된다. 만약 그렇지 않다면 팁은 20% 적용된다. Steven is still building his tip calculator, using the same rules as before: Tip 15% of the bill if the bill value is between 50 and 300, and if the value is different, the tip is 20%. Test data: 125, 555 and 44 Your tasks: 1. calcTip이라는 함수를 만들어서 값을 넣으면 위의 설정에 상응하는 팁을 반환하도록 하라. Write a function 'c..
문제) 돌고래팀과 코알라팀이 3번 경기를 한다. 팀별로 3번 경기의 평균 점수가 계산된다. 오직 상대편 평균점수의 2배를 달성한 팀만 이긴 것으로 간주된다. 그렇지 않을 경우엔 어느 팀도 이길수 없다. Each team competes 3 times, and then the average of the 3 scores is calculated (so one average score per team) . A team only wins if it has at least double the average score of the other team. Otherwise, no team wins! Test data: § Data 1: Dolphins score 44, 23 and 71. Koalas score 65,..

시작하기 전 설정 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 어디에 선언했냐..

기본적 세팅은 아래글 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 ..