首行缩进2个空格
eslint: indent
  1. functionhello (name) {
  2. console.log('hi', name)
  3. }

字符串使用单引号(除了避免转义)

eslint: quotes
  1. console.log('hello there')
  2. $("<div class='box'>")

禁止出现未使用的变量

eslint: no-unused-vars
  1. functionmyFunction () {
  2. var result =something() // ✗ avoid
  3. }

关键字后增加一个空格

eslint: keyword-spacing
  1. if (condition) { ... } // ✓ ok
  1. if(condition) { ... } // ✗ avoid

函数声明的圆括号前增加一个空格

  1. functionname (arg) { ... } // ✓ ok
  1. functionname(arg) { ... } // ✗ avoid
  1. run(function () { ... }) // ✓ ok
  1. run(function() { ... }) // ✗ avoid
使用严格运算符===替代相等运算符==
除了obj == null 允许检查 null || undefined
eslint: eqeqeq
  1. if (name === 'John') // ✓ ok
  2. if (name == 'John') // ✗ avoid
  1. if (name !== 'John') // ✓ ok
  2. if (name != 'John') // ✗ avoid

中缀运算符必须使用一个空格分开

eslint: space-infix-ops
  1. // ✓ ok
  2. var x = 2
  3. var message = 'hello, ' + name + '!'
  1. // ✗ avoid
  2. var x=2
  3. var message = 'hello, '+name+'!'

逗号后面紧跟一个空格

eslint: comma-spacing
  1. // ✓ ok
  2. var list = [1, 2, 3, 4]
  3. function greet (name, options) { ... }
  1. // ✗ avoid
  2. var list = [1,2,3,4]
  3. function greet (name,options) { ... }

else和后括号保持在同一行

eslint: brace-style
  1. // ✓ ok
  2. if (condition) {
  3. // ...
  4. } else {
  5. // ...
  6. }
  1. // ✗ avoid
  2. if (condition) {
  3. // ...
  4. }
  5. else {
  6. // ...
  7. }

多行if声明,使用花括号

eslint: curly
  1. // ✓ ok
  2. if (options.quiet !== true) console.log('done')
  1. // ✓ ok
  2. if (options.quiet !== true) {
  3. console.log('done')
  4. }
  1. // ✗ avoid
  2. if (options.quiet !== true)
  3. console.log('done')

函数参数err必须处理

  1. // ✓ ok
  2. run(function (err) {
  3. if (err) throw err
  4. window.alert('done')
  5. })
  1. // ✗ avoid
  2. run(function (err) {
  3. window.alert('done')
  4. })

必须使用浏览器全局参数window.前缀,除了document,console,navigator

eslint: no-undef
  1. window.alert('hi') // ✓ ok

多个空白行是不允许的

  1. // ✓ ok
  2. var value = 'hello world'
  3. console.log(value)
  1. // ✗ avoid
  2. var value = 'hello world'
  3.  
  4. console.log(value)

使用多行书写三元表达式时,?和:放在所属行

  1. // ✓ ok
  2. var location = env.development ? 'localhost' : 'www.api.com'
  3.  
  4. // ✓ ok
  5. var location = env.development
  6. ? 'localhost'
  7. : 'www.api.com'
  8.  
  9. // ✗ avoid
  10. var location = env.development ?
  11. 'localhost' :
  12. 'www.api.com'

使用var声明时,一个声明使用一个表达式

eslint: one-var
  1. // ✓ ok
  2. var silent = true
  3. var verbose = true
  4.  
  5. // ✗ avoid
  6. var silent = true, verbose = true
  7.  
  8. // ✗ avoid
  9. var silent = true,
  10. verbose = true

使用额外的括号包裹额外的赋值

eslint: no-cond-assign
  1. // ✓ ok
  2. while ((m = text.match(expr))) {
  3. // ...
  4. }
  5.  
  6. // ✗ avoid
  7. while (m = text.match(expr)) {
  8. // ...
  9. }

单行块里首尾增加空格

eslint: block-spacing
  1. function foo () {return true} // ✗ avoid
  2. function foo () { return true } // ✓ ok

变量和函数命名使用驼峰法

eslint: camelcase
  1. function my_function () { } // ✗ avoid
  2. function myFunction () { } // ✓ ok
  3.  
  4. var my_var = 'hello' // ✗ avoid
  5. var myVar = 'hello' // ✓ ok

禁止尾部加逗号

eslint: comma-dangle
  1. var obj = {
  2. message: 'hello', // ✗ avoid
  3. }

逗号放在当前行的末尾

eslint: comma-style
  1. var obj = {
  2. foo: 'foo'
  3. ,bar: 'bar' // ✗ avoid
  4. }
  5.  
  6. var obj = {
  7. foo: 'foo',
  8. bar: 'bar' // ✓ ok
  9. }

点号和属性保持同一行

eslint: dot-location
  1. console.
  2. log('hello') // ✗ avoid
  3.  
  4. console
  5. .log('hello') // ✓ ok

文件以换行符结束

elint: eol-last
标示符和请求之间不能有空格
  1. console.log ('hello') // ✗ avoid
  2. console.log('hello') // ✓ ok

键值对表达式的冒号和值之间要有空格

eslint: key-spacing
  1. var obj = { 'key' : 'value' } // ✗ avoid
  2. var obj = { 'key' :'value' } // ✗ avoid
  3. var obj = { 'key':'value' } // ✗ avoid
  4. var obj = { 'key': 'value' } // ✓ ok

构造方法的名字首字母大写

eslint: new-cap
  1. function animal () {}
  2. var dog = new animal() // ✗ avoid
  3.  
  4. function Animal () {}
  5. var dog = new Animal() // ✓ ok

无参构造方法调用时必须有圆括号

eslint: new-parens
  1. function Animal () {}
  2. var dog = new Animal // ✗ avoid
  3. var dog = new Animal() // ✓ ok

一个对象有setter方法的前提必须先订单getter方法

eslint: accessor-pairs
  1. var person = {
  2. set name (value) { // ✗ avoid
  3. this.name = value
  4. }
  5. }
  6.  
  7. var person = {
  8. set name (value) {
  9. this.name = value
  10. },
  11. get name () { // ✓ ok
  12. return this.name
  13. }
  14. }

派生类(继承类)的构造才能调用super

  1. class Dog {
  2. constructor () {
  3. super() // ✗ avoid
  4. }
  5. }
  6.  
  7. class Dog extends Mammal {
  8. constructor () {
  9. super() // ✓ ok
  10. }
  11. }

使用数组字面量代替数组构造函数

  1. var nums = new Array(1, 2, 3) // ✗ avoid
  2. var nums = [1, 2, 3] // ✓ ok

避免使用arguments.callee和arguments.caller

eslint: no-caller
  1. function foo (n) {
  2. if (n <= 0) return
  3.  
  4. arguments.callee(n - 1) // ✗ avoid
  5. }
  6.  
  7. function foo (n) {
  8. if (n <= 0) return
  9.  
  10. foo(n - 1)
  11. }

避免修改类声明变量

eslint: no-class-assign
  1. class Dog {}
  2. Dog = 'Fido' // ✗ avoid

避免修改const声明的变量

eslint: no-const-assign
  1. const score = 100
  2. score = 125 // ✗ avoid

避免在条件中使用常量表达式(循环例外)

  1. if (false) { // ✗ avoid
  2. // ...
  3. }
  4.  
  5. if (x === 0) { // ✓ ok
  6. // ...
  7. }
  8.  
  9. while (true) { // ✓ ok
  10. // ...
  11. }

正则表达式中禁止使用控制字符

  1. var pattern = /\x1f/ // ✗ avoid
  2. var pattern = /\x20/ // ✓ ok

不要使用debugger表达式

eslint: no-debugger
  1. function sum (a, b) {
  2. debugger // ✗ avoid
  3. return a + b
  4. }

不要在变量上使用delete运算符

eslint: no-delete-var
  1. var name
  2. delete name // ✗ avoid

函数定义时不要使用重复的参数

eslint: no-dupe-args
  1. function sum (a, b, a) { // ✗ avoid
  2. // ...
  3. }
  4.  
  5. function sum (a, b, c) { // ✓ ok
  6. // ...
  7. }
类成员中不能出现重复的名字
  1. class Dog {
  2. bark () {}
  3. bark () {} // ✗ avoid
  4. }

对象字面量中不能出现重复键值

eslint: no-dupe-keys
  1. var user = {
  2. name: 'Jane Doe',
  3. name: 'John Doe' // ✗ avoid
  4. }

switch表达式中不能出现重复的case值

  1. switch (id) {
  2. case 1:
  3. // ...
  4. case 1: // ✗ avoid
  5. }

每一个模块只能有一个import表达式

  1. import { myFunc1 } from 'module'
  2. import { myFunc2 } from 'module' // ✗ avoid
  3.  
  4. import { myFunc1, myFunc2 } from 'module' // ✓ ok

正则表达式中不能有空的字母类

  1. const myRegex = /^abc[]/ // ✗ avoid
  2. const myRegex = /^abc[a-z]/ // ✓ ok

不能有空的结构模式

  1. const { a: {} } = foo // ✗ avoid
  2. const { a: { b } } = foo // ✓ ok

禁止使用eval()

eslint: no-eval
  1. eval( "var result = user." + propName ) // ✗ avoid
  2. var result = user[propName] // ✓ ok

catch子句中不能重新分配异常

eslint: no-ex-assign
  1. try {
  2. // ...
  3. } catch (e) {
  4. e = 'new value' // ✗ avoid
  5. }
  6.  
  7. try {
  8. // ...
  9. } catch (e) {
  10. const newVal = 'new value' // ✓ ok
  11. }

不能扩展本地对象

  1. Object.prototype.age = 21 // ✗ avoid

避免不必要的函数绑定

eslint: no-extra-bind
  1. const name = function () {
  2. getName()
  3. }.bind(user) // ✗ avoid
  4.  
  5. const name = function () {
  6. this.getName()
  7. }.bind(user) // ✓ ok

避免不必要的布尔操作

  1. const result = true
  2. if (!!result) { // ✗ avoid
  3. // ...
  4. }
  5.  
  6. const result = true
  7. if (result) { // ✓ ok
  8. // ...
  9. }

避免不必要的括号包裹函数表达式

eslint: no-extra-parens
  1. const myFunc = (function () { }) // ✗ avoid
  2. const myFunc = function () { } // ✓ ok

switch的case表达式处理中使用break阻止继续下沉

eslint: no-fallthrough
  1. switch (filter) {
  2. case 1:
  3. doSomething() // ✗ avoid
  4. case 2:
  5. doSomethingElse()
  6. }
  7.  
  8. switch (filter) {
  9. case 1:
  10. doSomething()
  11. break // ✓ ok
  12. case 2:
  13. doSomethingElse()
  14. }
  15.  
  16. switch (filter) {
  17. case 1:
  18. doSomething()
  19. // fallthrough // ✓ ok
  20. case 2:
  21. doSomethingElse()
  22. }

不能有浮点小数

  1. const discount = .5 // ✗ avoid
  2. const discount = 0.5 // ✓ ok

避免重新分配函数声明

eslint: no-func-assign
  1. function myFunc () { }
  2. myFunc = myOtherFunc // ✗ avoid

避免重新分配只读全局变量

  1. window = {} // ✗ avoid

不使用隐式的函数

eslint: no-implied-eval
  1. setTimeout("alert('Hello world')") // ✗ avoid
  2. setTimeout(function () { alert('Hello world') }) // ✓ ok

嵌套块中不能有函数声明

  1. if (authenticated) {
  2. function setAuthUser () {} // ✗ avoid
  3. }

正则构造方法中不能出现无效的正则表达式

  1. RegExp('[a-z') // ✗ avoid
  2. RegExp('[a-z]') // ✓ ok

不能出现不规则的空白

  1. function myFunc () /*<NBSP>*/{} // ✗ avoid

不能使用_iterator_

eslint: no-iterator
  1. Foo.prototype.__iterator__ = function () {} // ✗ avoid

标签名不能和局部变量重名

eslint: no-label-var
  1. var score = 100
  2. function game () {
  3. score: 50 // ✗ avoid
  4. }

不能有标签声明

eslint: no-labels
  1. label:
  2. while (true) {
  3. break label // ✗ avoid
  4. }

不能有无用的嵌套块

eslint: no-lone-blocks
  1. function myFunc () {
  2. { // ✗ avoid
  3. myOtherFunc()
  4. }
  5. }
  6.  
  7. function myFunc () {
  8. myOtherFunc() // ✓ ok
  9. }

缩进时避免混合空格和tabs

除了缩进不要使用多个空格
eslint: no-multi-spaces
  1. const id = 1234 // ✗ avoid
  2. const id = 1234 // ✓ ok

禁止多行的字符串

eslint: no-multi-str
  1. const message = 'Hello \
  2. world' // ✗ avoid

没有给变量赋值对象时不要使用new

eslint: no-new
  1. new Character() // ✗ avoid
  2. const character = new Character() // ✓ ok

不要使用Function构造方法

eslint: no-new-func
  1. var sum = new Function('a', 'b', 'return a + b') // ✗ avoid

不要使用Object构造方法

eslint: no-new-object
  1. let config = new Object() // ✗ avoid

不要使用new require

eslint: no-new-require
  1. const myModule = new require('my-module') // ✗ avoid

不要使用Symbol构造方法

eslint: no-new-symbol
  1. const foo = new Symbol('foo') // ✗ avoid

不要使用原始包装器实例

eslint: no-new-wrappers
  1. const message = new String('hello') // ✗ avoid

不要调用全局对象属性作为函数

eslint: no-obj-calls
  1. const math = Math() // ✗ avoid

不要使用八进制字符

eslint: no-octal
  1. const num = 042 // ✗ avoid
  2. const num = '042' // ✓ ok

字符串中不要使用八进制转义序列

eslint: no-octal-escape
  1. const copyright = 'Copyright \251' // ✗ avoid

字符串拼接时避免使用__dirname和__filename

eslint: no-path-concat
  1. const pathToFile = __dirname + '/app.js' // ✗ avoid
  2. const pathToFile = path.join(__dirname, 'app.js') // ✓ ok

避免使用__proto__,使用getPrototypeOf来代替

eslint: no-proto
  1. const foo = obj.__proto__ // ✗ avoid
  2. const foo = Object.getPrototypeOf(obj) // ✓ ok

不要重复声明变量

eslint: no-redeclare
  1. let name = 'John'
  2. let name = 'Jane' // ✗ avoid
  3.  
  4. let name = 'John'
  5. name = 'Jane' // ✓ ok

正则表达式中避免出现多个空格

eslint: no-regex-spaces
  1. const regexp = /test value/ // ✗ avoid
  2.  
  3. const regexp = /test {3}value/ // ✓ ok
  4. const regexp = /test value/ // ✓ ok

return表达式中赋值时使用括号包裹

  1. function sum (a, b) {
  2. return result = a + b // ✗ avoid
  3. }
  4.  
  5. function sum (a, b) {
  6. return (result = a + b) // ✓ ok
  7. }

避免给变量本身赋值

eslint: no-self-assign
  1. name = name // ✗ avoid

避免变量本身比较

  1. if (score === score) {} // ✗ avoid

避免使用逗号表达式

eslint: no-sequences
  1. if (doSomething(), !!test) {} // ✗ avoid

受限关键字不能使用

  1. let undefined = 'value' // ✗ avoid

不允许稀疏数组出现

  1. let fruits = ['apple',, 'orange'] // ✗ avoid

Tabs禁止使用

eslint: no-tabs
常规字符串中不能包含模板占位符
  1. const message = 'Hello ${name}' // ✗ avoid
  2. const message = `Hello ${name}` // ✓ ok

super()必须在this之前调用

  1. class Dog extends Animal {
  2. constructor () {
  3. this.legs = 4 // ✗ avoid
  4. super()
  5. }
  6. }

只能抛出Error对象

  1. throw 'error' // ✗ avoid
  2. throw new Error('error') // ✓ ok

行尾不允许有空格

不能使用undefined初始化
eslint: no-undef-init
  1. let name = undefined // ✗ avoid
  2.  
  3. let name
  4. name = 'value' // ✓ ok

循环语句中循环条件要变更

  1. for (let i = 0; i < items.length; j++) {...} // ✗ avoid
  2. for (let i = 0; i < items.length; i++) {...} // ✓ ok

有更简单的形式存在时,不要使用三元表达式

  1. let score = val ? val : 0 // ✗ avoid
  2. let score = val || 0 // ✓ ok

return, throw, continue, break后不要有代码

eslint: no-unreachable
  1. function doSomething () {
  2. return true
  3. console.log('never called') // ✗ avoid
  4. }

finally语句块中不要有控制流语句

  1. try {
  2. // ...
  3. } catch (e) {
  4. // ...
  5. } finally {
  6. return 42 // ✗ avoid
  7. }

关系运算符的左操作数不能否定

  1. if (!key in obj) {} // ✗ avoid

避免不必要的使用.call()和.apply()

eslint: no-useless-call
  1. sum.call(null, 1, 2, 3) // ✗ avoid

在对象中避免使用不必要的计算属性键

  1. const user = { ['name']: 'John Doe' } // ✗ avoid
  2. const user = { name: 'John Doe' } // ✓ ok

不必要的构造方法

  1. class Car {
  2. constructor () { // ✗ avoid
  3. }
  4. }

避免不必要的转义

  1. let message = 'Hell\o' // ✗ avoid

导入、导出和解构赋值,不要赋相同的名字

  1. import { config as config } from './config' // ✗ avoid
  2. import { config } from './config' // ✓ ok

属性前不要有空格

  1. user .name // ✗ avoid
  2. user.name // ✓ ok
不要使用with表达式
eslint: no-with
  1. with (val) {...} // ✗ avoid

对象属性的行分配要保持一致

  1. const user = {
  2. name: 'Jane Doe', age: 30,
  3. username: 'jdoe86' // ✗ avoid
  4. }
  5.  
  6. const user = { name: 'Jane Doe', age: 30, username: 'jdoe86' } // ✓ ok
  7.  
  8. const user = {
  9. name: 'Jane Doe',
  10. age: 30,
  11. username: 'jdoe86'
  12. }

语句块中不要有空隙

eslint: padded-blocks
  1. if (user) {
  2. // ✗ avoid
  3. const name = getName()
  4.  
  5. }
  6.  
  7. if (user) {
  8. const name = getName() // ✓ ok
  9. }

传播运算符的表达式不能有空格

  1. fn(... args) // ✗ avoid
  2. fn(...args) // ✓ ok

分号前不能有空格,后必须有空格

eslint: semi-spacing
  1. for (let i = 0 ;i < items.length ;i++) {...} // ✗ avoid
  2. for (let i = 0; i < items.length; i++) {...} // ✓ ok

块语句前要有一个空格

  1. if (admin){...} // ✗ avoid
  2. if (admin) {...} // ✓ ok

圆括号内不能有空格

eslint: space-in-parens
  1. getName( name ) // ✗ avoid
  2. getName(name) // ✓ ok

一元运算符后要有空格

eslint: space-unary-ops
  1. typeof!admin // ✗ avoid
  2. typeof !admin // ✓ ok

注释内要有空格

eslint: spaced-comment
  1. //comment // ✗ avoid
  2. // comment // ✓ ok
  3.  
  4. /*comment*/ // ✗ avoid
  5. /* comment */ // ✓ ok

模板字符串中不能有空格

  1. const message = `Hello, ${ name }` // ✗ avoid
  2. const message = `Hello, ${name}` // ✓ ok

检查NaN时使用isNaN()

eslint: use-isnan
  1. if (price === NaN) { } // ✗ avoid
  2. if (isNaN(price)) { } // ✓ ok

typeof必须和有效的字符串比较

eslint: valid-typeof
  1. typeof name === 'undefimed' // ✗ avoid
  2. typeof name === 'undefined' // ✓ ok

直接调用函数表达式必要要被包装

eslint: wrap-iife
  1. const getName = function () { }() // ✗ avoid
  2.  
  3. const getName = (function () { }()) // ✓ ok
  4. const getName = (function () { })() // ✓ ok

yield*表达式中的*前后都应有一个空格

  1. yield* increment() // ✗ avoid
  2. yield * increment() // ✓ ok

避免使用尤达条件

eslint: yoda
  1. if (42 === age) { } // ✗ avoid
  2. if (age === 42) { } // ✓ ok

分号

不使用分号的情况
eslint: semi
  1. window.alert('hi') // ✓ ok
  2. window.alert('hi'); // ✗ avoid

开始行不要以(,[,`开头,否则前面要加分号

  1. // ✓ ok
  2. ;(function () {
  3. window.alert('ok')
  4. }())
  5.  
  6. // ✗ avoid
  7. (function () {
  8. window.alert('ok')
  9. }())

  1. // ✓ ok
  2. ;[1, 2, 3].forEach(bar)
  3.  
  4. // ✗ avoid
  5. [1, 2, 3].forEach(bar)
  1. // ✓ ok
  2. ;`hello`.indexOf('o')
  3.  
  4. // ✗ avoid
  5. `hello`.indexOf('o')

ESLint javascript格式要求的更多相关文章

  1. 屏蔽eslint代码格式报错

    1.在文件中找到node_modules 2.node_modules文件夹下的eslint-config-standard 3.打开eslint-config-standard文件夹下的eslint ...

  2. JavaScript 日期格式

    有四种 JavaScript 日期输入格式: 类型 实例 ISO 日期 "2018-02-19" (国际标准) 短日期 "02/19/2018" 或者 &quo ...

  3. 一统江湖的大前端(5)editorconfig + eslint——你的代码里藏着你的优雅

    <一统江湖的大前端>系列是自己的前端学习笔记,旨在介绍javascript在非网页开发领域的应用案例和发现各类好玩的js库,不定期更新.如果你对前端的理解还是写写页面绑绑事件,那你真的是有 ...

  4. 轻量高效的开源JavaScript插件和库 【转】

    图片 布局 轮播图 弹出层 音频视频 编辑器 字符串 表单 存储 动画 时间 其它 加载器 构建工具 测试 包管理器 CDN 图片 baguetteBox.js - 是一个简单易用的响应式图像灯箱效果 ...

  5. VSCode常用插件之ESLint使用

    更多VSCode插件使用请访问:VSCode常用插件汇总 ESLint这是VS Code ESLint扩展,将ESLint JavaScript集成到VS Code中. 首先简单说一下使用流程: 1. ...

  6. Json时间格式转换问题

    很多时候在数据库中取出数据,需要用Json来接收,但是接受出来的数据竟然是:/Date(1386040883000+0800)/ 这种格式. 这个时候就需要将Json格式,转换成Javascript格 ...

  7. 文本输入框和下拉菜单特效-用正则表达式验证E-mail格式

    ———————————————————————————— <script type="text/javascript">                         ...

  8. 用 React 整合 LogEntries JavaScript 库

    [编者按]本文作者为 David Posin,主要介绍 React 与 LogEntries 间的相互操作.本文系国内 ITOM 管理平台 OneAPM 编译呈现. 众所周知,React.js已经被证 ...

  9. 原生javascript实现异步的7种方式

    1.$(document).ready 点评: 需要引用jquery :兼容所有浏览器. 2.标签的async=”async”属性 async的定义和用法(是HTML5的属性) async 属性规定一 ...

随机推荐

  1. python -- 犯过的错之变量作用域

    1.写代码时发现取得变量值,会被覆盖,改为图二的写法后case_id则不会覆盖. 原因:可以理解为变量是内存中一个对象的“引用”.在函数参数传值时,变量也是内存对象的引用. 当对象为可更改对象时,是引 ...

  2. 从GitLab上拉到本地仓库的项目导入到eclipse中

    拉项目 在本地仓库中右键git clone,填写地址 OK, 然后在拉下来的项目上面右键检出创建dev分支. 要将新分支导入到eclipse中, 如果是没有导入过就选第三个,导入过就选第一个. 然后O ...

  3. MyBatis 关联查询的实现:一对一

    有2个实体:用户.会员卡,一个用户只能办理一张会员卡,即一对一. user_tb : 需要在一方引入另一方的主键作为外键. card_tb: 使用扩展类 (1)在pojo包下新建User类: pack ...

  4. 使用DOM4J生成XML文档

    package xml; import java.io.FileOutputStream; import java.util.ArrayList; import java.util.List; imp ...

  5. 使用navicat连接mysql8.0.12版本 出现client does not support。。。解决办法

    navicat版本的问题 出现连接失败的原因:mysql8 之前的版本中加密规则是mysql_native_password,而在mysql8之后,加密规则是caching_sha2_password ...

  6. request和response的setCharacterEncoding()方法

    1.pageEncoding=”UTF-8”的作用是设置JSP编译成Servlet时使用的编码.2.contentType=”text/html;charset=UTF-8”的作用是指定服务器响应给浏 ...

  7. 吴裕雄--天生自然TensorFlow2教程:合并与分割

    import tensorflow as tf # 6个班级的学生分数情况 a = tf.ones([4, 35, 8]) b = tf.ones([2, 35, 8]) c = tf.concat( ...

  8. 吴裕雄--天生自然 JAVASCRIPT开发学习:输出

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  9. LinkedList源码阅读笔记

    LinkedList LinkedList是双向链表,不循环(1.6之前循环),继承AbstractSequentialList类,实现了List, Deque, Cloneable接口. 链表的特点 ...

  10. 动手动脑 4 String 类

    动手动脑1: 请运行以下示例代码StringPool.java,查看其输出结果.如何解释这样的输出结果?从中你能总结出什么?       在Java中,内容相同的字串常量(“Hello”)只保存一份以 ...