和大家分享一个 javascript shell

JavaScriptShell是一款支持多行输入、变量定义及函数创建等功能的JavaScript解释器。它允许用户在一个提示符下输入表达式和语句,并显示每条非空语句或表达式的结果。此工具还具备错误消息显示、上下文运行等功能。


Javascript Shell 地址:http://www.squarefree.com/shell/

 

Features

  • You can enter statements and expressions at the same prompt.
  • The result of each non-void statement or expression is shown.
  • User-defined variables.
    • b = document.body
  • User-defined functions.
    • function f() { return 5; }
  • JavaScript error messages are shown in red.
  • Previous statements and expressions are available through Up and Down arrow keys.
  • Tab completion.
  • Multiline input (Shift+Enter to insert a line break).
  • If the shell is opened using a bookmarklet, JavaScript typed into the shell runs in the context of the original window.
  • Works well in Firefox, mostly works in Opera 8 and in IE 6 for Windows.

Built-in functions

  • ans : the result of the previous expression.
  • print(expr) : prints expr on its own line.
    • for(i = 0; i < 6; ++i) print( i * i)
  • pr(expr) : prints and returns its input, so you can use it to print intermediate results in the middle of an expression.
    • function fact(n) { return n>0 ? pr( n*fact(n-1)) : 1 }
  • blink(node) or Alt+B : makes a node blink for a second.
    • blink( document.links[3])
  • props(obj) or Alt+P : lists the methods and fields of an object.
    • props( document.body)
    • In Firefox, props also shows which properties belong to the object itself and which belong to objects in its prototype chain.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值