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. MySQL高级查询和编程基础

    第一章 数据库设计 一.数据需求分析: 数据需求分析是为后续概念设计和逻辑结构设计做准备. 结构:(1)对现实世界要处理的对象进行详细的调查. (2)收集基础数.据. (3)对所收集的数据进行处理. ...

  2. Windos下的6种IO模型简要介绍

    windows进行数据的收发有6种IO模型.分别是阻塞(blocking)模型,选择(select)模型,异步选择(WSAAsyncSelect)模型,事件选择(WSAEventSelect )模型, ...

  3. Sphinx全文索引安装教程

    首先了解一下sphinx全文索引的相关知识官方网站:http://www.sphinxsearch.com/ 官方文档:http://www.sphinxsearch.com/docs/ 中文支持:h ...

  4. ZBrush中Nudge推动笔刷介绍

    本文我们来介绍Nudge推动笔刷,该笔刷在使用时能够产生旋转涂抹的效果,Nudge笔刷允许您在模型表面移动顶点,而这些移动的顶点仍然停留在模型的原来的表面,它与Move笔刷还是不同的,利用Move笔刷 ...

  5. 路飞学城Python-Day27(复习)

    简单的socket通信 import socket client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) client.connect( ...

  6. create raid5

    # umout 所有数据disk for i in {1..11};do umount /disk$i;done # 修改/etc/fstab,注释掉 /dev/sd[b-l] vim /etc/fs ...

  7. DRF lazy Serializer

    class LazySerializer: def __init__(self, cls_name, **kwargs): self.cls_name = cls_name self.kwargs = ...

  8. 2017CCPC秦皇岛

    热身赛 B题 Smartphone: 大整数相乘 Time Limit: 1 Second Memory Limit: 65536 KBHelianthuswolf Co. Ltd. is a mul ...

  9. [CTSC1999][网络流24题]补丁VS错误

    题目:洛谷P2761.vijos P1019.codevs1239.codevs2218. 题目大意:有n个错误,m个不同的补丁. 对于一个补丁,有两个不同的字符串描述.具体如下: 如果当前错误包含第 ...

  10. pip常见用法汇总

    1.pip安装 yum -y install epel-release && yum -y install python-pip 2.pip安装软件 (1)安装单个软件:pip ins ...