JavaScript

2741. N 찍기
const fs = require('fs'); const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = fs.readFileSync(filePath).toString().split('\n'); function solution() { for (let i = 1; i

Ajax
fetch('html').then(function(response){ response.text().then(function(text){ document.querySelector('article').innerHTML = text; }) }); fetch('html'); 첫번째 인자로 전달된 데이터를 서버에게 요청하는 함수 then 이하 서버가 준비될 때까지 다른 일을 하겠다. function callbackme() { } fetch('html').then(callbackme); fetch API야. 응답이 끝나면 callbackme 라는 함수를 실행시켜줘. function callbackme() { console.log('response end'); } fetch('html').then(callbackme..