JavaScript

JavaScript

2022/06/29 (增加連結)

JavaScript basics

JavaScript雖然有個Java,可是在很多方面與Java都不一樣,例如:變數的使用方式,JavaScript是動態資料型態,也就是同一個變數的資料型態可以是不一樣的。

if (123 && "hello"){ //true

alert(123 && "hello"); //"hello"

}

              • Primitive to string

              • Primitive to number

            • Object Coercion

            • Symbol Coercion

    • Implicit Return

    • Implicit Function Params

    1. Divide and conquer

    2. Make things embarrassingly obvious

    3. Resolve magic numbers and strings

    4. Fight nesting

    5. Configure hard

    6. Frameworks are there to help

      • React

      • Angular / VueJS / Ember

      • jQuery / lodash / or similar

      • Vanilla / No framework

    7. Unless it is a prototype — write tests

    8. Use version control

    9. Manage state responsibly

    10. Question trends

Variables

Data Types

正確的寫法

['1', '7', '11'].map(numStr => parseInt(numStr));

Conditional Statement / Operators

Operators

Abstraction

Functions (詳參: Functions)

Objects

Class /OOP

Prototypes

Array

正確的寫法

['1', '7', '11'].map(numStr => parseInt(numStr));

Loop

RegExp (ES3)

Error Handling (ES3)

Guard Clauses

Scope

Execution Context and Stack

This

Let / Const (ES6, ES2015)

Performance

Algorithms & Data Structures

JavaScript Object Notation (JSON)

URL

Clean code

Advanced JavaScript

Functional JS

Module

StyleSheet

API / HTTP request

** API 這部分需要重新整理 **

Cache

BOM (Browser Object Model)

Web Storage

DOM (Document Object Model)

Dialog

Browser APIs

Cookie

CORS

GraphQL

JWT (JSON Web Tokens)

jQuery

JAMstack

JS Delivery

Notification

Observer API

Push API

Shape Detection API

Router

RxJS

Test

Socket.io

Environment Variable

Lodash

var _ = require('lodash');

var newObject = _.cloneDeep(theObjectThatNeedsCloningHere);

Package

NPM

Bundler

Webpack

Console

Debugger

Versioning

Service worker

Web worker

相關工具

相關應用

Animation

Audio

Authetication

Checkbox

DataDrivenJS

Drag and Drop

Excel

File

Hardware

iFrame

Image

IndexedDB

Internationalization

Menu

PDF

Security

Speech

Timezone

Trait

Video

Visualization

Webcam

ECMAScript (ES)

ECMAScript其實就是JavaScript的標準,目前最新的版本是ECMAScript 2018 (ECMAScript 9),版本間的差異請詳參JavaScript VersionsTHE COMPLETE ECMASCRIPT 2015-2017 GUIDE

Vanilla Javascript

其實,所謂的Vanilla Javascript,不是一個新的javascript,而是指不用任何framework的純javascript

ECMAScript 5 (ES5, ES2009)

ECMAScript 6 (ES6, ES2015)

const price = 24.99;

const payments = 3;

const salesPitch =

`Only ${payments} easy payments

of $${price}!`

      • What Are Tagged Template Literals

        • Simply put, tags are functions that perform custom parsing of a template literal. A Template literal is “tagged” when you use one of these custom parsers. A popular library that uses this feature is styled-components. This library builds “styled components” by parsing template strings with their custom tags.

ECMAScript 7 (ES2016, ES7)

ECMAScript 8 (ES2017, ES8)

ECMAScript 9 (ES2018, ES9)

ECMAScript 10 (ES2019)

ES 2020

ES2021

ES2022

Future

參考文件