- Underscore.JS 教程
- Underscore.JS - 主页
- Underscore.JS - 概览
- Underscore.JS - 环境设置
- Underscore.JS - 迭代集合
- Underscore.JS - 处理集合
- Underscore.JS - 迭代数组
- Underscore.JS - 处理数组
- Underscore.JS - 函数
- Underscore.JS - 映射对象
- Underscore.JS - 更新对象
- Underscore.JS - 比较对象
- Underscore.JS - 实用程序
- Underscore.JS - 链式调用
- Underscore.JS 的实用资源
- Underscore.JS - 快速指南
- Underscore.JS - 实用资源
- Underscore.JS - 讨论
Underscore.JS - unescape 方法
语法
_.unescape(string)
unescape 方法用实际字符替换 HTML 特殊字符替换对应项。请参见以下示例 −
示例
var _ = require('underscore');
// Example 1
var result1 = _.unescape('Joe, Rob & Larry');
// Example 2
var result2 = _.unescape('3 > 2');
console.log(result1);
console.log(result2);
将上述程序另存为 tester.js。运行以下命令以执行此程序。
命令
\>node tester.js
输出
Joe, Rob & Larry 3 > 2
underscorejs_utilities.htm
Advertisement 1