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?

JavaScript: template literalの変技

Posted at

template literalの中に`を記述するには\`などとしなければならないが…。

入れ子
a=`${`${`${``}`}`}`

関数呼び出しの()を省略して `...`などと記述

普通
alert`0`
返事が…
//ない。ただのシシカバのようだ…
eval`alert(0)`
//あるぇ?
setTimeout`alert(1)`
2重
Function`alert(1)```
多重
Function`return a=>alert```````
連携
Function`return a=>a=>alert`()``(``)`()`
new
new Function``
new Function()``
new class{constructor(){return Function``}}()``
new class{constructor(){return Function}}()``
ソノメイレイハ、リカイフノウデス
new String``
new class{constructor(){return Function}}``
new class{}()``
new class{}``

非常に言いにくい事なのだが…この問題は冷静に対処する必要がある(^o^)

0
0
2

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?