본문 바로가기
IT/JavaScript와 Framework

javascript-sample-001-기능

by 골든크랩 2022. 10. 6.
728x90
반응형

 

<!doctype html>
<html>
  <head>
    <title>Console Demo</title>
  </head>
  <body>
    <h1>Hello, World!</h1>
    <script>
      console.log('Loading!');
      const h1 = document.querySelector('h1');
      console.log(h1.textContent);
      console.assert(document.querySelector('h2'), 'h2 not found!');
      const artists = [
        {
          first: 'René',
          last: 'Magritte'
        },
        {
          first: 'Chaim',
          last: 'Soutine'
        },
        {
          first: 'Henri',
          last: 'Matisse'
        }
      ];
      console.table(artists);
      setTimeout(() => {
        h1.textContent = 'Hello, Console!';
        console.log(h1.textContent);
      }, 3000);
    </script>
  </body>
</html>

 

출처:

https://developer.chrome.com/docs/devtools/console/?hl=ko 

 

728x90
반응형

'IT > JavaScript와 Framework' 카테고리의 다른 글

javascript 클래스 예제  (0) 2022.10.13
javascript 비구조화 할당(destructuring assginment)  (0) 2022.10.13
자바스크립트에서 ... 의미  (0) 2022.10.04
자바스크립트 디버깅  (0) 2022.09.28
Promise, Code Runner  (0) 2022.09.20

댓글