-

   rss_rss_hh_new

 - e-mail

 

 -

 LiveInternet.ru:
: 17.03.2011
:
:
: 51

:


Bare words JavaScript

, 14 2017 . 02:12 +
, , WAT.
bare words, Ruby.
image
(barewords) , .

JavaScript , , , .

:
with(bareWords) {
    alert( + )
    console.log(We, can, use, bare, words)
}
.
:
try {
    let self = this
    window.bareWords = new Proxy({}, {
        has: function(target, name) {
            return !(name in self)
        },
        get: function(target, name) {
            return name
        },
    })
} catch(e) {
    console.error('Your browser doesn't support bare words.')
}
, , , Proxy with.

this, - with, , .

.
image
, Github
Original source: habrahabr.ru (comments, light).

https://habrahabr.ru/post/333030/

:  

: [1] []
 

:
: 

: ( )

:

  URL