In B4Coder you build a program from flowchart blocks, run it step by step, then press View Code to see it as JavaScript. Change the flowchart and the JavaScript changes with it.
JavaScript runs in every web browser, so the code B4Coder writes runs as it is: paste it into your browser's console. It's the language of websites and web apps.
About the code B4Coder writes: Runs just like your flowchart. Try it in your browser's console.
The most common blocks, and the JavaScript they turn into. View Code uses your own names and values.
age = Number(prompt("How old are you?"));console.log("Hello, " + name);let total = 0;
if (age >= 18) {
...
} else {
...
}for (let i = 0; i < 10; i++) {
...
}while (total < 100) {
...
}Each one is a flowchart in B4Coder. This is the JavaScript it turns into, exactly as View Code writes it.
Ask for two numbers and show the sum.
let a, b, sum;
a = Number(prompt("What is the first number?"));b = Number(prompt("What is the second number?"));sum = a + b;console.log("The sum is " + sum);Check whether a number is even or odd.
let number;
number = Number(prompt("Enter a number"));if (number % 2 === 0) { console.log("It is an Even number");} else { console.log("It is an Odd number");}Use a repeat loop to count from 1 to 10.
let count;
count = 1;for (let i0 = 0, n0 = 10; i0 < n0; i0++) { console.log("Count: " + count); count = count + 1;}Build a flowchart, press Run to watch it work, then open View Code and pick JavaScript. It's free, with no install.
Open the editor