当前位置:网站首页>`${}`的用法
`${}`的用法
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);
边栏推荐
- Build your own website (22)
- 牛客网:龙与地下城游戏
- Share how to make professional hand drawn electronic maps
- JS获取display为none的隐藏元素的宽度和高度的解决方案
- [error record] the flutter reports an error (could not read script 'xxx\flutter\u tools\gradle\app\u plugin\u loader.gradle')
- 服务器响应状态码
- I admire that someone explained such an obscure subject as advanced mathematics so easily
- php优化foreach中的sql查询
- 20220702 how do programmers build knowledge systems?
- #include errors detected. Please update your includePath.
猜你喜欢
New feature of go1.18: introduce new netip Network Library
对象与对象变量
wait解决僵尸进程
【ODX Studio编辑PDX】-0.1-如何快速查看各Variant变体间的支持的诊断信息差异(服务,Sub-Function...)
[error record] the flutter reports an error (could not read script 'xxx\flutter\u tools\gradle\app\u plugin\u loader.gradle')
牛客网:最大子矩阵
NC50965 Largest Rectangle in a Histogram
Radis:Linux上安装Redis(步骤)
Developers share | HLS and skillfully use Axi_ Customize the master bus interface instructions and improve the data bandwidth - area exchange speed
Promise optimized callback hell
随机推荐
php实现根据输入的年龄查询出生日期符合的数据
[shutter] shutter gesture interaction (small ball following the movement of fingers)
JS获取display为none的隐藏元素的宽度和高度的解决方案
[001] [arm-cortex-m3/4] internal register
Meibeer company is called "Manhattan Project", and its product name is related to the atomic bomb, which has caused dissatisfaction among Japanese netizens
[QT] QT multithreading development - reentrancy and thread safety
[shutter] shutter application theme (themedata | dynamic modification theme)
Market Research - current market situation and future development trend of aircraft audio control panel system
[leetcode] sword finger offer 04 Search in two-dimensional array
Task and privilege level protection
PHP implements querying the data matching the date of birth according to the entered age
【leetcode】1380. Lucky number in matrix
Market Research - current situation and future development trend of environmental friendly fireworks Market
New feature of go1.18: trylock, which has been tossed n times
数据库系统概论第一章简答题-期末考得怎么样?
U++ 学习笔记 堆
佩服,竟然有人把高等数学这么晦涩难懂的科目,讲解得如此通俗易懂
Oracle cursor
Market Research - current market situation and future development trend of aircraft wireless intercom system
[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)