Output
Output
Function
output is used to write values to the console. It is often used to debug scripts, view running results, or generate command line output.
print outputs content without automatic line wrapping.
Syntax
print(value) print value
Examples
// Output: Hello (with a space at the end) print('Hello ') // Output: BT print('BT') // Output: Hello (with a space at the end) print 'Hello ' // Output: BT print 'BT'
println
println outputs the content and breaks the line at the end, which is more suitable for debugging and logging.
Syntax
println(value) println value
Examples
println('Hello BT') println 'Hello BT'
echo
echo is a system output function, which will convert all parameters into strings, connect them with spaces and output them.
Syntax
echo(value1, value2, ...) echo value
Examples
echo('BT', 1) echo 'BT'
Return Value
print and println are language output statements, which will return the output value; echo is a system function, and empty will be returned after the output is completed.