Single Page Application (SPA)

functional programming language

map()

// array of numbers
const numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
// get squqre of each number
const squares = numbers.map((number) => number ** 2)

function reference

// here the function1 is a function reference
// to the function body
function function1() {
console.log('inside function1')
}

export and import

export

// App.jsx
export function App() {
...
}
// main.jsx
// importing with same name as that of the exported entity
import {App} from './App.jsx'
// importing with an alias
import {App as MyApp} from './App.jsx'