12 KiB
| title | chunk | source | category | tags | date_saved | instance |
|---|---|---|---|---|---|---|
| Signature (functions) - Glossary | MDN | 1/3 | https://developer.mozilla.org/en-US/docs/Glossary/Signature/Function | reference | web, html, css, javascript, documentation | 2026-05-05T05:45:18.977541+00:00 | kb-cron |
MDN HTML HTML: Markup language
HTML reference
HTML guides
Markup languages
CSS reference
CSS guides
Layout cookbook
JavaScriptJS JavaScript: Scripting language
JS reference
JS guides
Web APIs Web APIs: Programming interfaces
Web API reference
Web API guides
- Using the Web animation API
- Using the Fetch API
- Working with the History API
- Using the Web speech API
- Using web workers
Technologies
Topics
Learn Learn web development
Frontend developer course
- Getting started modules
- Core modules
- MDN Curriculum
- Check out the video course from Scrimba, our partner
Learn HTML
Learn CSS
Learn JavaScript
Tools Discover our tools
About Get to know MDN better
Signature (functions)
A function signature (or type signature, or method signature) defines input and output of functions or methods. A signature can include:
- parameters and their types
- a return value and type
- exceptions that might be thrown or passed back
- information about the availability of the method in an object-oriented program (such as the keywords
public,static, orprototype).
In this article
In depth
Signatures in JavaScript
JavaScript is a loosely typed or a dynamic language. That means you don't have to declare the type of a variable ahead of time. The type will get determined automatically while the program is being processed. A signature in JavaScript can still give you some information about the method:
- The method is installed on an object called
MyObject. - The method is installed on the
prototypeofMyObject(thus it is an instance method) as opposed to being a static method. - The name of the method is
myFunction. - The method accepts one parameter, which is called
valueand is not further defined.
Signatures in Java
In Java, signatures are used to identify methods and classes at the level of the virtual machine code. You have to declare types of variables in your code in order to be able to run the Java code. Java is strictly typed and will check any parameters at compilation time if they are correct.
- The
publickeyword is an access modifier and indicates that this method can be called by any object. - The
statickeyword indicates that this method is a class method as opposed to being an instance method. - The
voidkeyword indicates that this method has no return value. - The name of the method is
main. - The method accepts one parameter of type String Array. It is named
args.
See also
- Java internal type signatures on Wikipedia