Skip to content

cotrFunc

Creates a function

Aliases:

  • cotrFunc
  • function
  • subprogram
  • procedure
  • subroutine
  • method

cpp

void myFunction(parameters) {
// Your code here
}

csharp

public void MyFunction(parameters)
{
// Your code here
}

dart

void myFunction(parameters) {
// Your code here
}

go

func MyFunction(parameters) void {
// Your code here
}

haskell

functionName :: parameterTypes -> returnType
functionName parameters = expression

java

public void myFunction() {
// Your code here
}

javascript

function myFunction() {
// Your code here
}

javascriptreact

function myFunction() {
// Your code here
}

kotlin

fun myFunction(): Unit {
// Your code here
}

perl

sub myFunction {
my () = @_;
# Your code here
}

php

function myFunction() {
// Your code here
}

powershell

Terminal window
function myFunction {
param (
)
# Your code here
}

python

def my_function():
# Your code here

r

my_function <- function() {
# Your code here
}

ruby

def my_function()
# Your code here
end

rust

fn my_function() -> void {
// Your code here
}

scala

def myFunction(): Unit = {
// Your code here
}

shellscript

Terminal window
myFunction() {
// Your code here
}

swift

func myFunction() -> Void {
// Your code here
}

typescript

function myFunction(): void {
// Your code here
}

typescriptreact

function myFunction(): void {
// Your code here
}