일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- java
- 자바 public
- 자바 삼항연산자
- 자바 향상된 for문
- 변수
- 자바 구구단 출력
- 항해99 2기
- 정보처리기사실기
- 자바 강제 캐스팅
- react ag grid
- 자바 if문
- 자바
- 조코딩
- 프로그래머스
- 자바 switch문
- 자바 공배수
- 자바 스캐너
- react with typescript
- 자바 조건문
- 자바 for문
- 자바 반복문
- 타입스크립트
- 이클립스 DB연동
- 자바 while문
- 항해99
- 자바 자동캐스팅
- TypeScript
- Til
- MySQL
- Vue3
- Today
- Total
목록WEB/Java Script (37)
뇌 채우기 공간

$.ajax({ type: "GET", url: "여기에URL을입력", data: {}, success: function(response){ console.log(response) } }) script부분 함수를 실행할 부분에 넣는다 function q1() { $('#names-q1').empty() $.ajax({ type: "GET", url: "http://openapi.seoul.go.kr:8088/6d4d776b466c656533356a4b4b5872/json/RealtimeCityAir/1/99", data: {}, success: function(response){ let rows = response['RealtimeCityAir']['row'] for (let i = 0; i< rows...
함수 인자와 spread const myFunction(a) { // 여기서 a 는 파라미터 console.log(a); // 여기서 a 는 인자 } myFunction('hello world'); // 여기서 'hello world' 는 인자 함수를 만들때 매개변수는 파라미터, 함수를 사용할 때 매개변수로 넣는 값은 인자 function sum(...rest) { return rest.reduce((acc, current) => acc + current, 0); } const numbers = [1, 2, 3, 4, 5, 6]; const result = sum( numbers[0], numbers[1], numbers[2], numbers[3], numbers[4], numbers[5] ); cons..

const purpleCuteSlime = { name: '슬라임', attribute: 'cute', color: 'purple' }; // 객체에 비구조화 할당을 하면서 rest를 써주었다. const { color, ...rest } = purpleCuteSlime; console.log(color); // rest안에 color을 제외한 값들이 들어가있다. // rest이름은 바꿀 수 있다. console.log(rest); 배열에서의 rest const numbers = [0, 1, 2, 3, 4, 5, 6]; const [one, ...rest] = numbers; console.log(one); console.log(rest); 배열에서의 rest는 맨 마지막에 와야하고 제외한 것들을 모아서..

... 이거를 사용한다 spread spread 라는 단어가 가지고 있는 의미는 펼치다, 퍼뜨리다이다. 이 문법을 사용하면, 객체 혹은 배열을 펼칠 수 있다. const slime = { name: '슬라임' }; const cuteSlime = { name: '슬라임', attribute: 'cute' }; const purpleCuteSlime = { name: '슬라임', attribute: 'cute', color: 'purple' }; 기존의 객체가 가진 것이랑 또 추가해서 객체를 만들고 싶으면 spread 문법이 유용하다. const slime = { name: '슬라임' }; const cuteSlime = { ...slime, attribute: 'cute' }; const purpleCu..

function calculateCircleArea(r){ return Math.PI *r*r; } const area = calculateCircleArea(4); console.log(area); const area1 =calculateCircleArea(); console.log(area1); 이렇게 function을 만들어주었다. 그리고 파라미터에 아무것도 넣지 않으면 NaN이 나온다. function calculateCircleArea(r){ const radius = r|| 1; return Math.PI *radius*radius; } 아무것도 넣지 않았을때 기본값을 설정하려면 이렇게 하면 된다. radius에 r이나 1을 넣으면 된다 이것은 앞서 배웠듯이 r이 없으면 1이 나온다. 2021..