일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- dfs
- useAppDispatch
- MSA
- React
- webpack
- 공변성
- ESlint
- async/await
- SSR
- 타입 좁히기
- 리터럴 타입
- 무한 스크롤
- 인증/인가
- TS
- CI/CD
- Jest
- Promise
- 투포인터
- 인터섹션
- 결정 알고리즘
- map
- app router
- recoil
- tailwind
- 호이스팅
- RTK Query
- autosize
- 반공변성
- CORS
- 태그된 유니온
- Today
- Total
목록전체 글 (522)
짧은코딩

명언 넣기 Math.random()을 하면 랜덤 값이 나온다. Math.random() * 10을 하면 0~10 사이 값이 나오는데 소수점도 나온다. 이 소수점을 없애는 함수는 3가지가 있다. 1. round Math.round(1.0)는 1로 반환, 반환할때 반올림해서 돌려준다. 2. ceil Math.ceil(1.1)은 2가 된다. 1.01도 2로 반환한다. 천장까지 올려준다는 의미이다. 3. floor Math.floor(1.1)은 1이 된다. 1.99도 1로 반환한다. 바닥까지 내려준다. const quotes = [ { quote: "최고 높이의 산을 오를 때에도 한 번 한 걸음에서 시작한다. ", author: "바바라 월터스", }, { quote: "우리가 정복하는 것은 산이 아니라 우리 ..

const clock = document.querySelector("h2#clock"); //혹은 #clock이나 clock로만 써도된다. h2 + id로 사용하는 방식을 사용했다. function sayHello(){ //2초마다 실행하는 함수 console.log("hello"); } setInterval(sayHello, 5000)//2가지 파라미터를 받고 첫번째는 내가 실행하고자하는 함수, 두번째는 호출되는 간격 단위는 ms interval은 매번 일어나는 것, ex) 매 2초마다 무슨 일이 일어나게 하는 것이다. setInterval 함수는 인자를 2개 받는데 하난 사용할 함수를 받고 다른건 시간(ms단위로)을 받는다. setInterval은 5초마다 계속 실행 const clock = docu..

콘솔에 localStorage.setItem("username", "nico") 입력하면 어플리케이션에 이렇게 저장된다. localStorage.getItem("username") localStorage.removeItem("username") 이런 명령어로 가져올 수도 있고 삭제할 수도 있다. const loginForm = document.querySelector("#login-form"); const loginInput = document.querySelector("#login-form input"); const greeting = document.querySelector("#greeting"); const HIDDEN_CLASSNAME = "hidden" function onLoginSumbit(..
https://www.acmicpc.net/problem/1766 1766번: 문제집 첫째 줄에 문제의 수 N(1 ≤ N ≤ 32,000)과 먼저 푸는 것이 좋은 문제에 대한 정보의 개수 M(1 ≤ M ≤ 100,000)이 주어진다. 둘째 줄부터 M개의 줄에 걸쳐 두 정수의 순서쌍 A,B가 빈칸을 사이에 두고 주 www.acmicpc.net 참고한 사이트 https://freedeveloper.tistory.com/390 [이것이 코딩 테스트다 with Python] 36강 위상 정렬 4https://www.youtube.com/watch?v=xeSz3pROPS8&list=PLVsNizTWUw7H9_of5YCB0FmsSc-K44y81&index=36 위상 정렬 사이클이 없는 방향 그래프의 모든 노드를 방..
https://www.acmicpc.net/problem/7662 7662번: 이중 우선순위 큐 입력 데이터는 표준입력을 사용한다. 입력은 T개의 테스트 데이터로 구성된다. 입력의 첫 번째 줄에는 입력 데이터의 수를 나타내는 정수 T가 주어진다. 각 테스트 데이터의 첫째 줄에는 Q에 적 www.acmicpc.net 내 풀이(구글링해서 찾아보고 안보고 풀음) import heapq t = int(input()) rst = [] for i in range(t): n = int(input()) chk = [False]*1_000_001 max = [] min = [] for j in range(n): x = list(input().split()) if x[0] == 'I': heapq.heappush(max,..
Log In const loginForm = document.getElementById("long-form"); const loginInput = loginForm.querySelector("input"); const loginButton = loginForm.querySelector("button"); 이런 방법으로 html의 버튼을 js에서 가져올 수 있다. const loginInput = document.querySelector("#login-form input"); const loginButton = document.querySelector("#login-form button"); 이렇게 하면 코드를 더 줄일 수 있다. const loginInput = document.querySelector(..
console.dir()에서 on이 앞에 붙어있는 것은 이벤트이다. const title = document.querySelector("div.hello:first-child h1"); function handleMouseEnter(){ console.log("mouse is here!"); } title.addEventListener("mouseenter", handleMouseEnter) 마우스 위로 올라가면 콘솔에 뜬다. const title = document.querySelector("div.hello:first-child h1"); function handleTitleClick() { title.style.color = "blue"; } function handleMouseEnter(){ ti..
https://programmers.co.kr/learn/courses/30/lessons/42576 코딩테스트 연습 - 완주하지 못한 선수 수많은 마라톤 선수들이 마라톤에 참여하였습니다. 단 한 명의 선수를 제외하고는 모든 선수가 마라톤을 완주하였습니다. 마라톤에 참여한 선수들의 이름이 담긴 배열 participant와 완주한 선수 programmers.co.kr 내 풀이(힌트 보고 맞춤) def solution(participant, completion): answer = '' participant.sort() completion.sort() for i in range(len(participant)): if i > len(completion) - 1: answer = participant[i] bre..
const age = prompt("How old are you?"); console.log(typeof "15", typeof parseInt("15")); prompt 입력창을 띄워주지만 구방식이라 요즘엔 안쓴다 typeof 타입형을 판단해 출력 parseInt 문자열을 int형으로 바꿔준다 const age = parseInt(prompt("How old are you?")); console.log(age); 입력을 int로 바꿔서 해준다. const age = parseInt(prompt("How old are you?")); console.log(isNaN(age)); isNaN()은 is Not a Number 이란 뜻 논리 연산자 and: && or: || document, dir docum..
변수 const는 업데이트를 할 수 없다. let는 업데이트 가능, 한번만 쓰면 그 다음부턴 타입을 안써도 된다. =>const가 기본, let 가끔, var는 쓰면 안됨 객체 클래스 같은 느낌 const player={ name:"nico", points:10, fat:true }; console.log(player); console.log(player.name); console.log(player["name"]); // 이건 nico 나옴 함수 function sayHello(nameOfPerson){ console.log("Hello my name is " + nameOfPerson); } sayHello("nico"); sayHello("dal"); sayHello("lynn"); const pl..