JavaScript - 01_Day_Introduction

Yuri Lee·2020년 11월 5일
0
post-custom-banner

Adding JavaScript to a Web Page

자바스크립트는 웹 페이지에 3개의 다른 방법으로 추가될 수 있다.

  • Inline script
  • Internal script
  • External script
  • Multiple External scripts

Inline Script

<!DOCTYPE html>
<html>
  <head>
    <title>30DaysOfScript:Inline Script</title>
  </head>
  <body>
    <button onclick="alert('Welcome to 30DaysOfJavaScript!')">Click Me</button>
  </body>
</html>

Internal Script

<!DOCTYPE html>
<html>
  <head>
    <title>30DaysOfScript:Internal Script</title>
    <script>
      console.log('Welcome to 30DaysOfJavaScript')
    </script>
  </head>
  <body></body>
</html>

Introduction to Data types

자바스크립트의 대표적인 데이터 타입은 다음과 같다. String, Number, Boolean, undefined, Null, and Symbol

Checking Data Types

typeof operator 을 통해 판별 가능하다.

console.log(typeof 'Asabeneh') // string
console.log(typeof 5) // number
console.log(typeof true) // boolean
console.log(typeof null) // object type
console.log(typeof undefined) // undefined

Variables

We will not use var in this challenge and I don't recommend you to use it. It is error prone way of declaring variable it has lots of leak. We will talk more about var, let, and const in detail in other sections (scope). For now, the above explanation is enough.

A valid JavaScript variable name must follow the following rules:

  • A JavaScript variable name should not begin with a number.
  • A JavaScript variable name does not allow special characters except dollar sign and underscore.
  • A JavaScript variable name follows a camelCase convention.
  • A JavaScript variable name should not have space between words.

https://github.com/Asabeneh/30-Days-Of-JavaScript

profile
Step by step goes a long way ✨
post-custom-banner

0개의 댓글