eval is a function which evaluates a string as though it were an expression and returns a result; in others, it executes multiple lines of code as though they had been included instead of the line including the eval.

JavaScript[edit]

In JavaScript, eval is something of a hybrid between an expression evaluator and a statement executor. It returns the result of the last expression evaluated.

Example as an expression evaluator:

foo = 2;
alert(eval('foo + 2'));

Example as a statement executor:

foo = 2;
eval('foo = foo + 2;alert(foo);');

One use of JavaScript's eval is to parse JSON text, perhaps as part of an Ajax framework. However, modern browsers provide JSON.parse as a more secure alternative for this task.

https://en.wikipedia.org/wiki/Eval

Implementation

In interpreted languages, eval is almost always implemented with the same interpreter as normal code. In compiled languages, the same compiler used to compile programs may be embedded in programs using the eval function; separate interpreters are sometimes used, though this results in code duplication.

http://dictionary.sensagent.com/Eval/en-en/

eval-Evaluation的更多相关文章

  1. Html和JS基础

    1.body:bgcolor,background(背景图片),bgproperities=fixed(图片水印),text(正文颜色). 2.hr:水平分割线,正文标题<h?>自动换行了 ...

  2. Java机器学习框架deeplearing4j入门教程

    1.添加项目maven添加依赖 or 导入jar包 or 使用jvm <project xmlns="http://maven.apache.org/POM/4.0.0" x ...

  3. [Pandas] 04 - Efficient I/O

    SQLITE3接口 调动 SQLITE3数据库 import sqlite3 as sq3 query = 'CREATE TABLE numbs (Date date, No1 real, No2 ...

  4. Paddle预训练模型应用工具PaddleHub

    Paddle预训练模型应用工具PaddleHub 本文主要介绍如何使用飞桨预训练模型管理工具PaddleHub,快速体验模型以及实现迁移学习.建议使用GPU环境运行相关程序,可以在启动环境时,如下图所 ...

  5. Non-standard evaluation, how tidy eval builds on base R

    As with many aspects of the tidyverse, its non-standard evaluation (NSE) implementation is not somet ...

  6. Evaluation of Expression Tree

    Evaluation of Expression Tree Given a simple expression tree, consisting of basic binary operators i ...

  7. Windows Server 2012从Evaluation版转成正式版

    步骤 运行->CMD(管理员)->输入DISM /online /Get-CurrentEdition 看你的Edition ID是什么,如果是Evaluation的话,例如Standar ...

  8. Weka开发[3]-Evaluation类

    上一次最后的结果就是一个分类的值,可能让大家大失所望,这一次会给大家一个比较完美的答案,这就是Evaluation类,这次只讲一下最简单的用法,首先初始化一个Evaluation对象,Evaluati ...

  9. JavaScript eval() 为什么使用eval()是一个坏主意 什么时候可以使用eval()

    ---------------------------------------------------------------------------------------------------- ...

  10. Alpha,Beta,RC,RTM,EVAL,CTP,OEM,RTL,VOL

    微软的一个系统(如Win 7)或开发工具(VS系列),往往会对应很多种版本,下面就介绍一下这些版本的含义:   Alpha (阿尔法,希腊字母的第一位'α',代表最初的版本) Alpha是内部测试版, ...

随机推荐

  1. js 判断设备的来源

    function deviceType(){ var ua = navigator.userAgent; var agent = ["Android", "iPhone& ...

  2. Lambda 表达式-即匿名函数

    拉姆达值(Lambda),希腊字母表示为Λ,指与真空的空间有关的能量或暗能量.   代表转换的常量.或者转换本身.   Lambda 表达式 Lambda 表达式”是一个匿名函数,可以包含表达式和语句 ...

  3. 悦享双节,Guitar Pro也来凑份热闹!

    光阴似箭,又是一个金秋的十月,祖国迎来了第68个生日,不同以往的是今年的中秋佳节与国庆假日重叠在一起了,这算不算是喜上加喜呢? 提到国庆人们的耳边总是会响起了一遍又一遍的国歌“起来,起来不愿做奴隶的人 ...

  4. css3新增的属性有哪些

    徐先森讲web CSS3新增的属性有哪些: CSS 用于控制网页的样式和布局. CSS3 是最新的 CSS 标准. CSS3新增了很多的属性,下面一起来分析一下新增的一些属性: 1.CSS3边框: b ...

  5. AC Codeforces Round #499 (Div. 2) E. Border 扩展欧几里得

    没想出来QAQ....QAQ....QAQ.... 对于一般情况,我们知道 ax+by=gcd(a,b)ax+by=gcd(a,b)ax+by=gcd(a,b) 时方程是一定有解的. 如果改成 ax+ ...

  6. 路飞学城Python-Day32

    36-进程池线程池 开多线程实现并发的效率是高的,当用户没有那么多的时候,服务器是可以承受压力的 但是一定要以某种方式来设置并发数,让服务器能够实现稳定的运行,控制服务器的线程数 设置池,往里面放池的 ...

  7. CodeForces-366C Dima and Salad 对01背包的理解 多个背包问题

    题目链接:https://cn.vjudge.net/problem/CodeForces-366C 题意 给出n个水果和一个常数k,其中每个水果都有两种性质ai, bi(美味度,卡路里量). 要保证 ...

  8. 好文应该收藏-----redis 配置自启动

    话不多说,请看原作者笔记,亲测,可用 https://blog.csdn.net/qq_42810276/article/details/81296012

  9. SQL的运算符优先级

    注: 1.乘除的优先级高于加减: 2.同一优先级运算符从左向右执行: 3.括号内的运算先执行.

  10. VUE:过滤器及日期格式化moment库

    VUE:过滤器及日期格式化moment库 <!DOCTYPE html> <html> <head> <meta charset="UTF-8&qu ...