Javascript Basics

skang6283·2021년 1월 31일
0

FrontEnd

목록 보기
4/4

Data types

  • numbers(int,float, ...)
  • strings
  • Booleans(true,false)
  • varibles
    ...

Declare variable

var varName = value; 

Connect html to js source file

<script src = "mysccript,js"></script>

Operators

== //compares value
=== //compares both value and type

  //same for other comparisons
!==, >==, <==, ...
!, &&, ||

For Loop

for(letter of arr){
	console.log(letter)
}

arr.forEach(console.log())

Javascript Object

  • Hash-tables (or dictionary)
  • no ordering, thus for loop does not guarantee ordering
var info = {make:"car", mask:"cover"}
info["make"]	//need quotation marks

console.dir(info) //to see entire object

for (key in carInfo){
  console.log(key)           //key
  console.log(carInfo[key])  //value
}

For more info about javascript
https://developer.mozilla.org/en-US/

profile
Hi :) I'm Max

0개의 댓글