Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Sichere ProgrammierungBreeze TTS 2 vs ElevenLabs: Open Source TTS Verdict(23.09.2026 um 05:44 Uhr)
Sichere ProgrammierungAgentic AI vs Generative AI: The 2026 Verdict(23.09.2026 um 05:44 Uhr)
Sichere ProgrammierungI made my agent prove every quote against the source document(23.09.2026 um 05:45 Uhr)
Sichere Programmierung8mb.video Alternative: Skip the Line, Skip the Upsell(23.09.2026 um 05:47 Uhr)
Sichere ProgrammierungBuilding a GTA 6 JSON API for entities and current status(23.09.2026 um 05:52 Uhr)
Sichere ProgrammierungEvery filter needs a documented exception(23.09.2026 um 06:01 Uhr)
Sichere ProgrammierungBreeze TTS 2 vs ElevenLabs: Open Source TTS Verdict(23.09.2026 um 05:44 Uhr)
Sichere ProgrammierungAgentic AI vs Generative AI: The 2026 Verdict(23.09.2026 um 05:44 Uhr)
Sichere ProgrammierungI made my agent prove every quote against the source document(23.09.2026 um 05:45 Uhr)
Sichere Programmierung8mb.video Alternative: Skip the Line, Skip the Upsell(23.09.2026 um 05:47 Uhr)
Sichere ProgrammierungBuilding a GTA 6 JSON API for entities and current status(23.09.2026 um 05:52 Uhr)
Sichere ProgrammierungEvery filter needs a documented exception(23.09.2026 um 06:01 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

#1 Funtions in JavaScript

1.JavaScript function is a block of code designed to perform a particular task. 2.A JavaScription function is executed when someone calls it . Syntax function name(parameter1, parameter2, parameter3) { // code to be…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Image description1.JavaScript function is a block of code designed to perform a particular task.



2.A JavaScription function is executed when someone calls it .






Syntax






function name(parameter1, parameter2, parameter3) {
// code to be executed
}






1.Function keyword followed by function name and paranthesis '()'



2.Paranthesis may include parameters separated by commas.



3.The code to be executed by the function is placed inside the curly brackets {}



4.Function parameters are named placeholders in the function definition.



5.Arguments are actual values passed to the function when it is called.

Function arguments behave like 'local variables'.





Let us get to know What are local variables?



1.A variable that is declared within a specific scope such as function or a blcok of code (like if statement, for loop or while loop).



2.The key characteristic of a local variable is limited accesibility. It can be accessed within the code where it was defined .




function calculateSum(num1, num2) {
// 'sum' is a local variable, accessible only within calculateSum()
let sum = num1 + num2;
console.log(sum);
}

calculateSum(5, 10); // Output: 15

// Attempting to access 'sum' outside the function will result in an error
// console.log(sum); // ReferenceError: sum is not defined









Function Return



1.A Return statement is used to specify a value that should be returned from a function when it is called .



2.Once a return statement is executed the function stops running and the specified value is sent back to where the function was called .




Example 1:Returning a Value

function add(a, b) {
return a + b;
}

let result = add(3, 4);
console.log(result); // Output: 7










Example 2: Returning Nothing (undefined)

function greet(name) {
console.log("Hello, " + name);
}

let result = greet("Alice");
console.log(result); // Output: undefined






How to Fix It (if you want a return value):




If you want greet() to return a value instead of just printing it:


function greet(name) {
return "Hello, " + name;
}

let result = greet("Alice");
console.log(result); // Output: Hello, Alice
Now the function returns a string, and that value is stored in result.









Why Functions?




  1. With Functions you can reuse the code .


  2. Can use the same code with different arguments and get different results.


Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten #1 Funtions in JavaScript

Thematisch verwandte Begriffe: Funtions, JavaScript · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-18163 | IBM Financial Transaction Manager (FTM) for RedHat OpenShift could allow…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick