Drag the background!

Step 3. Functions and Return

This shows how a function can "return" a value to whatever called it.

This World displays nothing on the screen. It writes to the console. To access the console press something like Ctrl-Shift-J or Command-Option-J or F12, depending on your browser.

Instead of "println" this World uses the P5 function print() to print to the console. You can also use the standard JavaScript console.log(). Or you can use the Ancient Brain function AB.msg() to write a message to the run header.

World

Tutorial 5.3
Functions and Return. Nothing on screen. See console for output.
The background is a program, showing the JavaScript graphics used on this site.
The globes light up when you log in.
 
Font:

Users retain ownership of user content.

Platforms      Stats      The name      Terms and conditions

Call for partners      Contact

Call for partners!
Ancient Brain is looking for a partner to co-write a JavaScript coding book for schools, to be used worldwide. This would be a course for students in learning to code from scratch. The book and course will be integrated into the Ancient Brain site. This is an opportunity for someone looking to develop a course and textbook to partner with a site to promote it. Read more.