ES6

import引入与{}

//A.js

module.exports = {
    a:aa,
    b:bb
}

//B.js 引入,以下方式都对
import A from './A'
import myA from './A'

//以下方式都错
import {A} from './A'
import {myA} from './A'
//A.js

export const a_config = {
    a:aa,
    b:bb
}
export const other_config = {
    c:cc,
    d:dd
}

module.exports = {
    abc:a_config,
    other_config:other_config
}

//B.js 引入,以下方式都对
import {abc} from './A'
import {other_config} from './A'
import config from './A' //默认第一个

箭头函数

(a,b)=>{
    let c = 'hello'
    return c + a + b
}
js
JSRUN前端笔记, 是针对前端工程师开放的一个笔记分享平台,是前端工程师记录重点、分享经验的一个笔记本。JSRUN前端采用的 MarkDown 语法 (极客专用语法), 这里属于IT工程师。