Skip to content

Resource

Lecture 3 - Programming Language Foundation - A Bigger Landscape

When we use function?

If requirements change frequently, we use function. You can see this code for a quick understanding.

Today's Task

  • Do a research to find the origins of the fundamentals.
App.js File

Variables helps us to make thing dynamic.

/* let a = 10 + 20 - 1;
let b = 20 + 30 - 1;
let c = 40 + 50 - 1;
let d = 10 + 20 - 1;
let e = 20 + 30 - 1;
let f = 40 + 50 - 1; */

let a = myFunction(10, 20);
let b = myFunction(20, 30);
let c = myFunction(40, 50);
let d = myFunction(10, 20);
let e = myFunction(20, 30);
let f = myFunction(40, 50);

function myFunction(a, b) {
    // return a + b - 1;
    // return a + b;
    return a ** a + b ** b;
}

/**
 * If we have data, make a variable for it
 */

Last update: July 6, 2022
Created: July 6, 2022