日期:2014-05-16 浏览次数:20350 次
Javascript Shell 地址:http://www.squarefree.com/shell/
?
b = document.body
function f() { return 5; }
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)
props
also shows which properties belong to the object itself and which belong to objects in its prototype chain.