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 JavaScripteval 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 languageseval 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. @DateTimeFormat无效原因

    一般都是使用@DateTimeFormat把传给后台的时间字符串转成Date,使用@JsonFormat把后台传出的Date转成时间字符串,但是@DateTimeFormat只会在类似@Request ...

  2. 《Exception》第八次团队作业:Alpha冲刺(第二天)

    一.项目基本介绍 项目 内容 这个作业属于哪个课程 任课教师博客主页链接 这个作业的要求在哪里 作业链接地址 团队名称 Exception 作业学习目标 1.掌握软件测试基础技术.2.学习迭代式增量软 ...

  3. Linux 进程及作业管理

    进程简介:  内核的功用:进程管理.文件系统.网络功能.内存管理.驱动程序.安全功能  进程(Process):什么是进程,进程是程序的执行实例,即运行中的程序,同时也是程序的一个副本:程序是放置于磁 ...

  4. HBase入门操作 常用命令和增删改查的简单应用操作

    这里启动关闭Hadoop和HBase的顺序一定是: 启动Hadoop—>启动HBase—>关闭HBase—>关闭Hadoop ssh localhost 开启hadoopcd /us ...

  5. python_字符串常用操作

    name = "monicao"name.capitalize() #首字母大写print(name.capitalize()) print(name.count("o& ...

  6. 洛谷 P1414 又是毕业季II (多个数的最大公因数)

    这道题其实不难,但是我想复杂了 我想的是把每个数质因数分解,然后每次就枚举每个质因数 来求最小公倍数. 然后想了想这样复杂度将会非常的大,肯定超时 然后看了题解发现不需要质因数分解,直接存因数的个数就 ...

  7. Java并发和多线程2:3种方式实现数组求和

    本篇演示3个数组求和的例子. 例子1:单线程例子2:多线程,同步求和(如果没有计算完成,会阻塞)例子3:多线程,异步求和(先累加已经完成的计算结果) 例子1-代码 package cn.fansuni ...

  8. Js原生实现抽奖功能

    <div>代码 按钮代码 JS原生代码  完整的代码: <div style="width:365px;height:300px;border:2px solid gree ...

  9. 【Codeforces Round #483 (Div. 2) C】Finite or not?

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 有个性质. 如果p/q是分数的最简形式. 那么p/q能化成有限小数. 当且仅当q的质因数分解形式中只有质因子2和5 (且不能出现其他 ...

  10. 在Windows系统下搭建Redis集群

    准备工作 需要4个部件:Redis.Ruby语言运行环境.Redis的Ruby驱动redis-xxxx.gem.创建Redis集群的工具redis-trib.rb.使用redis-trib.rb工具来 ...