console.log output

var bruh = "cool coding";
console.log(bruh);
cool coding

console.log as a Function

function print(output) {
    console.log(output)
}
print(bruh)
print(" ")
print("Can also be numbers:")
print(100)
cool coding
 
Can also be numbers:
100

Getting Input Types

function printType(output) {
    console.log("This is a", typeof output+":", output);
}
print("You don't have to specify what type of value inputs are (string or int)")
printType("Text");
printType(bruh); // bruh = a string, therefore...
printType(100);
printType([1,2,3]); // object is generic for arrays (array = list)
You don't have to specify what type of value inputs are (string or int)
This is a string: Text
This is a string: cool coding
This is a number: 100
This is a object: [ 1, 2, 3 ]

Coin Flipper

function coinFlip() {
    var flip = Math.random()
        if(flip < "0.5") {
            console.log("It's Heads!")
        } else if(flip > "0.5") {
            console.log("It's Tails!")
        }
        else {
            console.log("It landed on it's side!")
            // This is a 0.00000000000001% chance
        }
}

var coinCount = 10
while (coinCount>0) {
    coinCount=(coinCount-1);
    coinFlip();
}
It's Heads!
It's Tails!
It's Tails!
It's Tails!
It's Heads!
It's Heads!
It's Tails!
It's Tails!
It's Heads!
It's Tails!

Table with Java

function htmlsource() {
    // i could not figure out arrays
    return (
        "<head>" +
        "<style>" + 
        "table, th, td, tr {" +
        "border: 1px solid #000000;" +
        "text-align: left;" +
        "padding: 8px;" + 
        "}" +
        "</style>" +
        "</head>" +
        "<table>" +
        "<tr>" +
        "<th><b>" + "Name" + "</b></th>" +
        "<th><b>" + "Role" + "</b></th>" +
        "</tr>" +
        "<tr>" +
        "<td>" + "Aiden" + "</td>" +
        "<td>" + "Scrum Master" + "</td>" +
        "</tr>" +
        "<tr>" +
        "<td>" + "Dash" + "</td>" +
        "<td>" + "Backend Developer" + "</td>" +
        "</tr>" +
        "<tr>" +
        "<td>" + "Sabine" + "</td>" +
        "<td>" + "Frontend Developer" + "</td>" +
        "</tr>" +
        "<tr>" +
        "<td>" + "Aiden" + "</td>" +
        "<td>" + "Backend Developer" + "</td>" +
        "</tr>" +
        "</table>"
    )
    }
    $$.html(htmlsource());
Name Role
Aiden Scrum Master
Dash Backend Developer
Sabine Frontend Developer
Aiden Backend Developer