大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。
Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺
ES6 模板字符串
作用:简化字符串的拼接
语法:`字符串内容${变量}字符串内容`;
``为波浪线那个键的符号
代码示例:
<html ng-app='app' ng-controller='main' >
<head>
<meta charset="utf-8">
<meta name='viewport' content='width=device-width,user-scalable=no,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0'>
<script src='jq/jquery-3.4.1.js'></script>
<style>
</style>
</head>
<body >
<script>
let obj={
name:'jeff',age:18};
let str=`我的信息:${
obj.name},年龄:${
obj.age}`;
console.log(str);
</script>
</body>
</html>
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/171850.html原文链接:https://javaforall.net