JSFiddle - React, Tailwind, and code Playground

by Brock Callahan

JavaScript

function mannersTrainer(v="") {
    if (v === 'please') {
    	document.write('The magic word is "please"');
    	return v;
    }
    let i = prompt("What's the magic word?");
    return mannersTrainer(i);
}

function inc(n, i, stop) {
	console.log(`logging args. n: ${n}, i: ${i}, stop: ${stop}\n`);
	if (n >= stop) {
    	return n;
    }
    let a = (n + i > stop) ? n : n + i;
    return inc(a, i, stop);
}
document.write( inc(1,3,10) );