Skip to content

关于tagged template #12

@simon300000

Description

@simon300000

https://github.com/tanpero/JavaScript-Art-Tour/blob/master/第三章-数据/字符串.md#模板字符串

alert`123`

其实应该等于以下吧

alert([123])

String.raw 虽然是一个函数,但是不能使用括号进行调用,自然也不能用于普通字符串。

这里似乎是需要模拟tagged template那样

String.raw({raw: ['simon','000'] }, 3) // simon3000

参考资料
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingquestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions