当前位置:网站首页>js 将字符串作为js执行代码使用
js 将字符串作为js执行代码使用
2022-08-11 03:37:00 【nicenicecsy】
eval()可以动态解析和执行字符串,它直接把字符串当做Javascript代码执行
JavaScript规定,如果行首是大括号,一律解释为语句(即代码块)。如果要解释为表达式(即对象),必须在大括号前加上圆括号。
eval(’{test: 123}’)
eval(’({test: 123})’)
边栏推荐
猜你喜欢

分布式和集群的区别和联系

【FPGA】day19-二进制转换为十进制(BCD码)

Rotary array problem: how to realize the array "overall reverse, internal orderly"?"Three-step conversion method" wonderful array

二叉树相关代码题【较全】C语言

E-commerce project - mall time-limited seckill function system

作业8.10 TFTP协议 下载功能

你不知道的 console.log 替代品

Salesforce disbands the Chinese team, which CRM product is more suitable for the Chinese

高校就业管理系统设计与实现

STC8H开发(十五): GPIO驱动Ci24R1无线模块
随机推荐
I didn't expect MySQL to ask these...
Differences and connections between distributed and clustered
【LeetCode】Day112-重复的DNA序列
The impact of programmatic trading and subjective trading on the profit curve!
C语言 recv()函数、recvfrom()函数、recvmsg()函数
What has programmatic trading changed?
rac备库双节点查询到的表最后更新时间不一致
元素的BFC属性
UNI-APP_iphone bottom safe area
分布式和集群的区别和联系
VIT 源码详解
程序化交易的策略类型可以分为哪几种?
Goodbye Guangzhou paper invoices!The issuance of electronic invoices for accommodation fees will completely replace the invoices of hotels, restaurants and gas stations
"Life Is Like First Seen" is ill-fated, full of characters, and the contrast of Zhu Yawen's characters is too surprising
Multi-serial port RS485 industrial gateway BL110
输入起始位置,终止位置截取链表
watch监听
The "top pillar" slides, and new growth is extremely difficult to shoulder the heavy responsibility. Is Ali "squatting" to jump higher?
Briefly, talk about the use of @Transactional in the project
Environment configuration of ESP32 (arduino arduino2.0 VScode platform which is easy to use?)