Questions Concepts
GitHub icon


Functions - language feature

< >
Example from JavaScript, TypeScript:
function helloWorld() {console.log("hi")}
Example from Pug:
mixin article(title) .article .article-wrapper h1= title if block block else p No content provided +article('Hello world') +article('Hello world') p This is my p Amazing article
Example from Speedie:
function Example (|string| data) file <~ data
Example from Jule:
fn a_function() { // ... }
Example from Bel:
(fn (x) (+ x 1))
Example from Cyber:
func fib(n int) int: coyield if n < 2: return n return fib(n - 1) + fib(n - 2)
Example from BALGOL:

Languages with Functions include JavaScript, Python, PHP, Ruby, R, Scala, Ada, Kotlin, PowerShell, TypeScript, Lua, Julia, Bash, Erlang, Solidity, Verilog, Reason, Crystal, F#, OCaml, Groovy, VHDL, Pug, ABAP, X10, Opa, F*, SystemVerilog, Cython, C3, ATS, Speedie, janet, Koka, progsbase, IGOR Pro, Jule, Bel, Eclipse Command Language, Cyber, Q#, Ligo, Sophia, BALGOL

Languages without Functions include CSS

This question asks: Does the language have a concept of and syntax for functions?

Read more about Functions on the web: 1.

HTML of this page generated by Features.ts

View source

- Build the next great programming language Search Add Language Features Creators Resources About Blog Acknowledgements Queries Stats Sponsor Traffic Traffic Today Day 305 Logout