함수 정의

function
def

1 Bash[ | ]

greet() {
	echo 'hello'
}
greet
# hello

2 JavaScript[ | ]

function greet() {
	console.log("hello");
}
greet();
// hello
var greet = function() {
	console.log("hello");
}
greet();
// hello

3 PHP[ | ]

function greet() {
	print("hello");
}
greet();
# hello

4 Python[ | ]

def greet():
	print('hello')

greet()
# hello
def show_ answer():
	print(42)

show_answer()
# 42

5 Perl[ | ]

sub greet() {
	print "hello\n";
}

greet();

6 R[ | ]

greet <- function() {
  cat("hello")
}

greet()
## hello

7 Ruby[ | ]

def greet
   puts "hello" 
end

greet
# hello

8 Windows Batch[ | ]

@echo off
call :greet hello
goto :eof

:greet <resultVar>
echo %~1
goto :eof

9 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}