const ajax = new XMLHttpRequest(); //서버에 데이터 요청 보내기 위한 객체 선언
ajax.open('GET', 'https://api.hnpwa.com/v0/news/1.json', false); //요청할 데이터 위치 및 가져오기. false(동기) / true(비동기)
ajax.send(); // 서버에 요청 내용 보내기
const newsFeed = JSON.parse(ajax.response); // 출력처리. 요청한 데이터를 JSON 객체로 가져와서 저장. 서버에서 클라이언트에 대한 응답.
const ul = document.createElement('ul'); // ul 태그 생성
const li = document.createElement('li'); // li 태그 생성
li.innerHTML = newsFeed[0].title; // li 태그 내 불러온 데이터 할당
ul.appendChild(li); // ul 태그 하위에 li 태그 위치
document.getElementById('root').appendChild(ul); // id값이 root인 요소 하위에 ul 태그 위치
계속...