functions

functions


Node.js

function add(a, b) {
  return a + b
}

const result = add(2,3)
console.log(result)

Output

5

Go

package main

import "fmt"

func add(a int, b int) int {
    return a + b
}

func main() {
    result := add(2, 3)
    fmt.Println(result)
}

Output

5