Modern Javascript

Similar documents
PowerPoint 프레젠테이션

자바 프로그래밍

PowerPoint 프레젠테이션

1

5장.key

OCaml

초보자를 위한 C# 21일 완성

Week5

Javascript.pages

Microsoft Word - java19-1-midterm-answer.doc

KT AI MAKERS KIT 사용설명서 (Node JS 편).indd

chap10.PDF


PowerPoint 프레젠테이션

09-interface.key

Cluster management software

untitled

C++-¿Ïº®Çؼ³10Àå

rmi_박준용_final.PDF

Analytics > Log & Crash Search > Unity ios SDK [Deprecated] Log & Crash Unity ios SDK. TOAST SDK. Log & Crash Unity SDK Log & Crash Search. Log & Cras

신림프로그래머_클린코드.key

4. #include <stdio.h> #include <stdlib.h> int main() { functiona(); } void functiona() { printf("hihi\n"); } warning: conflicting types for functiona

PowerPoint Presentation

untitled

Ext JS À¥¾ÖÇø®ÄÉÀ̼ǰ³¹ß-³¹Àå.PDF

(8) getpi() 함수는정적함수이므로 main() 에서호출할수있다. (9) class Circle private double radius; static final double PI= ; // PI 이름으로 로초기화된정적상수 public

No Slide Title

PowerPoint Presentation

K&R2 Reference Manual 번역본

playnode.key

Lab10

untitled

교육2 ? 그림

Contents. 1. PMD ㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍ 2. Metrics ㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍ 3. FindBugs ㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍ 4. ㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍㆍ

SIGPLwinterschool2012

C# Programming Guide - Types

강의10

03장.스택.key

HW5 Exercise 1 (60pts) M interpreter with a simple type system M. M. M.., M (simple type system). M, M. M., M.

Tcl의 문법

歯처리.PDF

13주-14주proc.PDF

13ÀåÃß°¡ºÐ

02 C h a p t e r Java

DIY 챗봇 - LangCon

ch09

Connection 8 22 UniSQLConnection / / 9 3 UniSQL OID SET

03-JAVA Syntax(2).PDF

자바GUI실전프로그래밍2_장대원.PDF

Contents Contents 2 1 Abstract 3 2 Infer Checkers Eradicate Infer....

07 자바의 다양한 클래스.key

자바로

11 템플릿적용 - Java Program Performance Tuning (김명호기술이사)

10주차.key

Microsoft PowerPoint - a10.ppt [호환 모드]

Microsoft PowerPoint - 04-UDP Programming.ppt

PRO1_09E [읽기 전용]

Microsoft PowerPoint 세션.ppt

slide2

12-file.key

fundamentalOfCommandPattern_calmglow_pattern_jstorm_1.0_f…

Microsoft Word - java19-1-final-answer.doc

JMF2_심빈구.PDF

쉽게 풀어쓴 C 프로그래밍

Microsoft Word - ExecutionStack

Chap12

0. 표지에이름과학번을적으시오. (6) 1. 변수 x, y 가 integer type 이라가정하고다음빈칸에 x 와 y 의계산결과값을적으시오. (5) x = (3 + 7) * 6; x = 60 x = (12 + 6) / 2 * 3; x = 27 x = 3 * (8 / 4

class Sale void makelineitem(productspecification* spec, int qty) SalesLineItem* sl = new SalesLineItem(spec, qty); ; 2. 아래의액티비티다이어그램을보고 Java 또는 C ++,

MasoJava4_Dongbin.PDF

목차 BUG 문법에맞지않는질의문수행시, 에러메시지에질의문의일부만보여주는문제를수정합니다... 3 BUG ROUND, TRUNC 함수에서 DATE 포맷 IW 를추가지원합니다... 5 BUG ROLLUP/CUBE 절을포함하는질의는 SUBQUE

PowerPoint Presentation

ilist.add(new Integer(1))과 같이 사용하지 않고 ilist.add(1)과 같이 사용한 것은 자바 5.0에 추가된 기본 자료형과 해당 객체 자료 형과의 오토박싱/언박싱 기능을 사용한 것으로 오토박싱이란 자바 컴파일러가 객체를 요구하는 곳에 기본 자료형

교육자료

슬라이드 1

4장.문장

제4장 기본 의미구조 (Basic Semantics)

05-class.key

쉽게 풀어쓴 C 프로그래밍

10.ppt

DocsPin_Korean.pages

Microsoft PowerPoint - web-part03-ch19-node.js기본.pptx

C프로-3장c03逞풚

8장 문자열

구축환경 OS : Windows 7 그외 OS 의경우교재 p26-40 참조 Windows 의다른버전은조금다르게나타날수있음 Browser : Google Chrome 다른브라우저를사용해도별차이없으나추후수업의모든과정은크롬사용 한

03장

Secure Programming Lecture1 : Introduction

歯엑셀모델링

01-OOPConcepts(2).PDF

JMF3_심빈구.PDF

1. SNS Topic 생성여기를클릭하여펼치기... Create Topic 실행 Topic Name, Display name 입력후 Create topic * Topic name : 특수문자는 hyphens( - ), underscores( _ ) 만허용한다. Topi

Java ~ Java program: main() class class» public static void main(string args[])» First.java (main class ) /* The first simple program */ public class

Microsoft PowerPoint - java1-lab5-ImageProcessorTestOOP.pptx

歯JavaExceptionHandling.PDF

PowerPoint 프레젠테이션

목차 INDEX JSON? - JSON 개요 - JSONObject - JSONArray 서울시공공데이터 API 살펴보기 - 요청인자살펴보기 - Result Code - 출력값 HttpClient - HttpHelper 클래스작성 - JSONParser 클래스작성 공공

EMBARCADERO TECHNOLOGIES (Humphery Kim) RAD Studio : h=p://tech.devgear.co.kr/ : h=p://blog.hjf.pe.kr/ Facebook : h=p://d.com/hjfactory :

Microsoft PowerPoint - 14주차 강의자료

( )부록

UML

유니티 변수-함수.key

Transcription:

ES6 - Arrow Function Class Template String Destructuring Default, Rest, Spread let, const for..of Promises Module System Map, Set * Generator * Symbol * *

https://babeljs.io/

Babel is a JavaScript compiler.

ES5 *Transpile의 특성상 ES6+의 모든 기능을 지원하지는 않는다

function hello() { // This is comment console.log( Hello World! ) hello()

var Scope? var j = 0 for (var i=0;i<10;i++) { var j = i j? 1. 0 2. 9

var Scope? var j = 0 for (var i=0;i<10;i++) { var j = i j? 1. 0 2. 9 Variables declared within a JavaScript function, become LOCAL to the function. Javscript

if (true) { var x = 5 console.log(x)

if (true) { var x = 5 console.log(x)

(function() { console.log(myvar) var myvar = "local value" )()

(function() { console.log(myvar) var myvar = "local value" )()

(function() { console.log(myvar) var myvar = "local value" )()

(function() { console.log(myvar) var myvar = "local value" )() (function() { var myvar console.log(myvar) myvar = "local value" )()

(function() { console.log(myvar) var myvar = "local value" )() (function() { var myvar console.log(myvar) myvar = "local value" )()

let, const : Block-Scoped Variable function f() { { let x { // okay, block scoped name const x = "sneaky" // error, const x = "foo" // error, already declared in block let x = "inner"

if (true) { let x = 5 console.log(x)

if (true) { let x = 5 console.log(x)

let fruit = { name: Apple, count: 5

const x = 10; const y = 15; const p1 = { x: x, y: y

const x = 10; const y = 15; const p1 = { x: x, y: y const p2 = { x, y

const obj = { x: 10, y: 50, const arr = [ 1, 2, 3, ]

if (condition) { statement_1 else { statement_2 switch (expression) { case label_1: statements_1 [break]... default: statements_def [break]

false undefined null 0 NaN the empty string ( ")

try { throw "myexception" catch (e) { logmyerrors(e)

const arr = [5,4,3,2,1] for (let i = 0; i < arr.length; i++) { console.log(arr[i])

const arr = [4,3,2,1,0] for (let i = 0; i < arr.length; i++) { console.log(arr[i])

const arr = [4,3,2,1,0] for (let i in arr) { console.log(i)

const arr = [4,3,2,1,0]; for (let i in arr) { console.log(i)

const arr = [4,3,2,1,0] for (let o of arr) { console.log(o)

let arr = [3, 5, 7] arr.foo = "hello" for (let i in arr) { console.log(i) for (let i of arr) { console.log(i)

let arr = [3, 5, 7] arr.foo = "hello" for (let i in arr) { console.log(i) for (let i of arr) { console.log(i)

function square(number) { return number * number const n = square(3) // 9

function add(n1, n2) { return n1 * n2 const n = add(3, 5) // 8

fizzbuzz 1 n 3 fizz 5 buzz 15 fizzbuzz

function fizzbuzz(n) { if (n % 15 === 0) return fizzbuzz else if (n % 3 === 0) return fizz else if (n % 5 === 0) return buzz return n

const square = function (number) { return number * number let x = square(4) // x 16

const square = function (number) { return number * number //

function benchmark(f) { const start = new Date() f() const end = new Date() console.log(end.gettime() - start.gettime()) benchmark(function() { )

const square = function (number) { ; return number * number const square = (number) => { ; return number * number

function square(number = 5) { return number * number square() // 25

function multiply(multiplier,...theargs) { return theargs.map(function(x) { return multiplier * x ) const arr = multiply(2, 1, 2, 3); console.log(arr); // [2, 4, 6]

let [ a,, b ] = [1, 2, 3] // a === 1 b === 3

let [ a,, b ] = [1, 2, 3] // a === 1 b === 3 let { name = { name: Changje Jeong // name === Changje Jeong

let [ a, b, c = 3] = [1, 2] // a === 1 c === 3 let { a, b = -1 = { a : 5 // a === 5 b === -1

const instr = { firstname: Changje, lastname: Jeong, major: Computer Science ; function fullname({ firstname, lastname ) { return firstname + + lastname

let params = [ "hello", true, 7 ] const other = [ 1, 2,...params ]

let params = [ "hello", true, 7 ] const other = [ 1, 2,...params ] // [ 1, 2, "hello", true, 7 ]

let params = [ "hello", true, 7 ] const other = [ 1, 2,...params ] // [ 1, 2, "hello", true, 7 ] f(1, 2, params)

let params = [ "hello", true, 7 ] const other = [ 1, 2,...params ] // [ 1, 2, "hello", true, 7 ] f(1, 2, params) f(1, 2, hello, true, 7)

function fullname(firstname, lastname) { return firstname + + lastname function fullnamenew(firstname, lastname) { return `${firstname ${lastname`

let fruits = [,, ] fruits.map(fruit => ` ${fruit`) [,, ] fruits.filter(fruit => fruit.length > 1) [, ] fruits.sort() [,, ] -> fruits

// Array let fruits = [,, ] let i = fruits.indexof( ) if (i > -1) { if (fruits.includes( )) {

class Point { constructor(x, y) { this.x = x; this.y = y; move(x, y) { this.x = x; this.y = y;

class Point { constructor(x, y) { this.x = x; this.y = y; move(x, y) { this.x = x; this.y = y;

class Rectangle extends Shape { constructor (id, x, y, width, height) { super(id, x, y) this.width = width this.height = height class Circle extends Shape { constructor (id, x, y, radius) { super(id, x, y) this.radius = radius

fetch( http://www.naver.com')

)

function naver() { fetch('http://www.naver.com').then((resp) => console.log('success', resp.status)).catch((err) => console.log('failed', err)) async function naver() { try { const resp = await fetch('http://www.naver.com') console.log('success', resp.status) catch (err) { console.log('failed', err)

//------ lib.js ------ var sqrt = Math.sqrt; function square(x) { return x * x; function diag(x, y) { return sqrt(square(x) + square(y)); module.exports = { sqrt: sqrt, square: square, diag: diag, ; //------ main.js ------ var square = require('lib').square; var diag = require('lib').diag; console.log(square(11)); // 121 console.log(diag(4, 3)); // 5

//------ lib.js ------ var sqrt = Math.sqrt; function square(x) { return x * x; function diag(x, y) { return sqrt(square(x) + square(y)); module.exports = { sqrt: sqrt, square: square, diag: diag, ; //------ main.js ------ var square = require('lib').square; var diag = require('lib').diag; console.log(square(11)); // 121 console.log(diag(4, 3)); // 5

//------ lib.js ------ var sqrt = Math.sqrt; function square(x) { return x * x; function diag(x, y) { return sqrt(square(x) + square(y)); module.exports = { sqrt: sqrt, square: square, diag: diag, ; //------ lib.js ------ export const sqrt = Math.sqrt; export default function square(x) { return x * x; export function diag(x, y) { return sqrt(square(x) + square(y)); //------ main.js ------ import from lib'; import React, { Component, PropTypes from console.log(square(11)); // 121 console.log(diag(4, 3)); // 5 //------ main.js ------ var square = require('lib').square; var diag = require('lib').diag; console.log(square(11)); // 121 console.log(diag(4, 3)); // 5

Object Array Callback Arrow Function Class Template String Destructuring Default, Rest, Spread let, const Map for..of Promises Async/Await Module System