Nasal library/debug: Difference between revisions

Jump to navigation Jump to search
→‎local(): Add examples
(→‎Functions: Start local())
(→‎local(): Add examples)
Line 186: Line 186:
|param1 = frame
|param1 = frame
|param1text = Optional integer specifying the frame. Corresponds to the argument given to {{func link|caller()}}.
|param1text = Optional integer specifying the frame. Corresponds to the argument given to {{func link|caller()}}.
|example1 =  
|example1 = var n = 12;
|example2 =  
debug.local(); # prints "{ n: 12, arg: [] }"
|example2 = var sqr = func(a){
    debug.local(); # prints "{ a: 16 }"
    debug.local(1); # prints "{ sqr: <func>, arg: [] }"
    return a * a;
}
print(sqr(16));
}}
}}


Navigation menu