当前位置:网站首页>`${}`的用法
`${}`的用法
2022-07-02 22:06:00 【爬楼梯的前端小白】
在 `` 中可以使用 ${} 直接把变量和字符串拼接起来
用法
step1: 定义需要拼接进去的字符串变量
step2: 将字符串变量用${}包起来,再写到需要拼接的地方
let name = '彭于晏'
console.log( '名字为:'+name )
console.log( `名字为:${name} ` )
let a='Karry Wang';
let str=`I love ${a}, because he is handsome.`;
//注意:这行代码是用返单号引起来的
alert(str);
边栏推荐
- 'when to use const char * and when to use const char []' - when to use const char * and when to use const char []
- 对象与对象变量
- 图形视图框架
- 杰理之内置短按再长按,不管长按多长时间都是短按【篇】
- Share how to make professional hand drawn electronic maps
- Market Research - current situation and future development trend of cell-based seafood market
- Dynamic memory allocation (malloc calloc realloc free)
- [shutter] shutter gesture interaction (small ball following the movement of fingers)
- #include errors detected. Please update your includePath.
- [error record] the flutter reports an error (could not read script 'xxx\flutter\u tools\gradle\app\u plugin\u loader.gradle')
猜你喜欢

任务和特权级保护

#include errors detected. Please update your includePath.

Pointer and string

SimpleITK使用——3. 常见操作

大话云原生之负载均衡篇-小饭馆客流量变大了

Promise optimized callback hell
![[ODX studio edit PDX] -0.1- how to quickly view the differences in supported diagnostic information between variant variants (service, sub function...)](/img/2b/f31b81cedf37ca187bcaa20dfe0b83.png)
[ODX studio edit PDX] -0.1- how to quickly view the differences in supported diagnostic information between variant variants (service, sub function...)
![[shutter] shutter custom fonts (download TTF fonts | pubspec.yaml configure font resources | synchronize resources | globally apply fonts | locally apply fonts)](/img/27/8594ba0b49d5008b7469967babed17.jpg)
[shutter] shutter custom fonts (download TTF fonts | pubspec.yaml configure font resources | synchronize resources | globally apply fonts | locally apply fonts)

Build your own website (22)

Tencent three sides: in the process of writing files, the process crashes, and will the file data be lost?
随机推荐
[001] [arm-cortex-m3/4] internal register
It's not easy to say I love you | use the minimum web API to upload files (swagger support) # yyds dry inventory #
JS获取display为none的隐藏元素的宽度和高度的解决方案
Market Research - current situation and future development trend of sickle cell therapy Market
Objects and object variables
Il n'est pas nécessaire d'appuyer longtemps sur la fonction de démarrage pour modifier Jelly [chapitre]
杰理之修改不需要长按开机功能【篇】
Based on asp Net (used mobile phone sales management system) +asp Net+c # language +vs2010+ database can be used for course design and post design learning
Leetcode circular linked list (fast and slow pointer) code line by line interpretation
Oracle-PL/SQL编程
【外刊】睡眠与减肥
Market Research - current market situation and future development trend of genome editing mutation detection kit
New feature of go1.18: introduce new netip Network Library
Market Research - current market situation and future development trend of aircraft audio control panel system
Oracle cursor
[shutter] shutter page life cycle (initialization period | createstate | initstate | update period | build | destroy period | dispose)
[shutter] shutter opens a third-party application (url|launcher plug-in search and installation | url| launcher plug-in official example | open browser | open a third-party application)
Phpcms realizes the direct Alipay payment function of orders
Build your own website (22)
附加:【登录信息存储】与【登录状态校验】;(包括:总结了到目前为止,有关【登录信息存储】与【登录状态校验】的所有内容;)
https://blog.csdn.net/qq_34246965/article/details/108085291?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522165639630516781435488372%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&request_id=165639630516781435488372&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~top_click~default-2-108085291-null-null.142^v24^pc_rank_34,157^v15^new_3&utm_term=%24%7B%7D&spm=1018.2226.3001.4187