当前位置:网站首页>js 将字符串作为js执行代码使用
js 将字符串作为js执行代码使用
2022-08-11 03:37:00 【nicenicecsy】
eval()可以动态解析和执行字符串,它直接把字符串当做Javascript代码执行
JavaScript规定,如果行首是大括号,一律解释为语句(即代码块)。如果要解释为表达式(即对象),必须在大括号前加上圆括号。
eval(’{test: 123}’)
eval(’({test: 123})’)
边栏推荐
- 80端口和443端口是什么?有什么区别?
- 一次简单的 JVM 调优,学会拿去写到简历里
- The solution to the height collapse problem
- uni-app - 城市选择索引列表 / 通过 A-Z 排序的城市列表(uview 组件库 IndexList 索引列表)
- The last update time of the tables queried by the two nodes of the rac standby database is inconsistent
- Typescript study notes | Byte Youth Training Notes
- pathman_config、pathman_config_params 删除后,如何重建?
- Audio codec, using FAAC to implement AAC encoding
- MongoDB 基础了解(二)
- How to rebuild after pathman_config and pathman_config_params are deleted?
猜你喜欢
Multi-serial port RS485 industrial gateway BL110
二叉树相关代码题【较全】C语言
I didn't expect MySQL to ask these...
How does MSP430 download programs to the board?(IAR MSPFET CCS)
图解LeetCode——640. 求解方程(难度:中等)
AI+Medical: Using Neural Networks for Medical Image Recognition and Analysis
【FPGA】day22-SPI协议回环
EasyCVR接入GB28181设备时,设备接入正常但视频无法播放是什么原因?
QueryDet: Cascading Sparse Query Accelerates Small Object Detection at High Resolution
常用认证机制
随机推荐
rac备库双节点查询到的表最后更新时间不一致
Unity2D animation (1) introduction to Unity scheme - animation system composition and the function of use
AI+Medical: Using Neural Networks for Medical Image Recognition and Analysis
QueryDet: Cascading Sparse Query Accelerates Small Object Detection at High Resolution
【FPGA】名词缩写
DNS separation resolution and intelligent resolution
浅析一下期货程序化交易好还是手工单好?
The problem that Merge will be lost again after code Revert has been solved
Get the length of the linked list
Uni - app - access to Chinese characters, pinyin initials (according to the Chinese get pinyin initials)
Typescript study notes | Byte Youth Training Notes
Leetcode 108. 将有序数组转换为二叉搜索树
【LeetCode】Day112-repetitive DNA sequence
论文精度 —— 2017 CVPR《High-Resolution Image Inpainting using Multi-Scale Neural Patch Synthesis》
多商户商城系统功能拆解26讲-平台端分销设置
我的 archinstall 使用手册
The solution to the height collapse problem
[BX]和loop
元素的BFC属性
C语言之自定义类型------结构体