variables
Node.js
// function scoped
var foo = 'foo'
// block scoped
let bar = 'bar'
// constant
const qux = 'qux'
Go
(variables are block scoped in Go)
package main
func main() {
// explicit
var foo string = "foo"
// type inferred
var bar = "foo"
// shorthand
baz := "bar"
// constant
const qux = "qux"
}
当前内容版权归 miguelmota 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 miguelmota .