Functions

Other topics

Small Arrow functions

# creates a function with no arguments, which returns 3
get_three = () -> 
    return 3

# same as above
get_three = -> 3

# creates a function with arguments
add_three = (num) -> num + 3

# multiple arguments, etc.
add = (a, b) -> a + b

Contributors

Topic Id: 5723

Example Ids: 20258

This site is not affiliated with any of the contributors.