0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

javascript namespace implementation

Last updated at Posted at 2020-07-18
var VSKULL = {
    v1: "aiueo",
    f1: function(a1){
        return this.v1 + ":" + a1;    // 'this' is needed
    },
    v2: {},
}

let LSKULL = {
    l1: "l1l1l1"
}

const CSKULL = {
    c1: "c1c1c1"
}

const asdf = 'abc'
let l1 = 'lll'

console.log(asdf)
console.log(VSKULL.v1)
console.log(VSKULL.f1("hoge"))
console.log(l1, VSKULL.v2)

console.log(LSKULL.l1)
console.log(CSKULL.c1)

abc
aiueo
aiueo:hoge
lll {}
l1l1l1
c1c1c1

Refs.

https://techacademy.jp/magazine/14872
https://b.hatena.ne.jp/entry/s/codezine.jp/article/detail/11353

0
0
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?