Skip to main content
added 257 characters in body
Source Link
Esolanging Fruit
  • 15.5k
  • 21
  • 28

#Functions may output by calling a callback function or event

Functions may output by calling a callback function or event

The callback function should be inputtedprovided using a valid input method.

Example in JavaScript that outputs Hello world!:

f=>f("Hello world!")

This may be shorter than returning a value in some languages:

import random as r
def f(x):
    q=r.random()
    return(q+q/2)/2

As opposed to:

import random as r
def f(x,g):
    q=r.random()
    g((q+q/2)/2)

#Functions may output by calling a callback function or event

The callback function should be inputted using a valid input method.

Example in JavaScript that outputs Hello world!:

f=>f("Hello world!")

Functions may output by calling a callback function or event

The callback function should be provided using a valid input method.

Example in JavaScript that outputs Hello world!:

f=>f("Hello world!")

This may be shorter than returning a value in some languages:

import random as r
def f(x):
    q=r.random()
    return(q+q/2)/2

As opposed to:

import random as r
def f(x,g):
    q=r.random()
    g((q+q/2)/2)
Source Link
jimmy23013
  • 37k
  • 29
  • 35

#Functions may output by calling a callback function or event

The callback function should be inputted using a valid input method.

Example in JavaScript that outputs Hello world!:

f=>f("Hello world!")