Zum Hauptinhalt springen
•
Sichere ProgrammierungSo... I finally joined DEV(04.10.2026 um 06:48 Uhr)
•
Sichere ProgrammierungBest AI Note Taking App in 2026 (Tested: Notion, Obsidian, Mem…)(04.10.2026 um 06:48 Uhr)
•••
Sichere ProgrammierungFrom Junior to Staff: How to Build a Safe Team Culture as an Engineerr(04.10.2026 um 06:51 Uhr)
•
Sichere ProgrammierungI Almost Switched to Omarchy. Instead, I Omarchified Linux Mint.(04.10.2026 um 06:52 Uhr)
••
Sichere ProgrammierungBest Notion AI Alternatives in 2026(04.10.2026 um 06:56 Uhr)
•
Sichere ProgrammierungPerplexity Pro Pricing Explained: Free vs Pro vs Max in 2026(04.10.2026 um 06:57 Uhr)
••
Sichere ProgrammierungSo... I finally joined DEV(04.10.2026 um 06:48 Uhr)
•
Sichere ProgrammierungBest AI Note Taking App in 2026 (Tested: Notion, Obsidian, Mem…)(04.10.2026 um 06:48 Uhr)
•••
Sichere ProgrammierungFrom Junior to Staff: How to Build a Safe Team Culture as an Engineerr(04.10.2026 um 06:51 Uhr)
•
Sichere ProgrammierungI Almost Switched to Omarchy. Instead, I Omarchified Linux Mint.(04.10.2026 um 06:52 Uhr)
••
Sichere ProgrammierungBest Notion AI Alternatives in 2026(04.10.2026 um 06:56 Uhr)
•
Sichere ProgrammierungPerplexity Pro Pricing Explained: Free vs Pro vs Max in 2026(04.10.2026 um 06:57 Uhr)
•
Intelligence View
⚡ tsecurity.de Intelligence

What is a Function? Simple Explanation with Examples

what is function ? 1.function is a block of code that perform specific task. *block of code is a group of instruction to perform specific task. 2.Instead of…

Beitrag
0
Seite
0
↗ Quelle (dev.to)
Social ReaktionenReagiere als Erste:r — dein Feedback zählt!




what is function ?



1.function is a block of code that perform specific task.

*block of code is a group of instruction to perform specific task.

2.Instead of writing the same code again and again, you can write it once inside a function and reuse it whenever needed.



EXAMPLES;



function square(number) {

return number * number;

}



*In this case function is keyword, square is the function name what we named, inside the parentheses have parameters if we want to use so many parameters inside the parentheses then we must separate each of them with commas.



*if we want to execute this function, then we should call this name of function, this function name is square so we call this like square() or if we want to put arguments then we should call this like square(23) in this case what was happened is you imagine number(parameter) is the variable and arguments is variable value , what the value(arguments) we give while callback that value will store in variable(parameters)



for example:

let calculation = square(2) --- => this returned number * number

console.log (calculation)

Then final output is --- 4 (2*2 --- => number*number)



Inside calculation have function that entire function returned (number * number) right then we print the variable calculation then output is 4 because my arguments is 2*2 =>4



REFERENCE WEBSITE;

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Functions

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten What is a Function? Simple Explanation with Examples

Thematisch verwandte Begriffe: What, Function, Simple, Explanation · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
Nächster Beitrag