Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
IT NachrichtenTelekom: Neuer Reise-eSIM-Dienst T-Travel startet weltweit(21.09.2026 um 11:45 Uhr)
IT NachrichtenSamsung Wallet: Neue Banken mit an Bord(21.09.2026 um 13:07 Uhr)
IT NachrichtenTelekom: Neuer Reise-eSIM-Dienst T-Travel startet weltweit(21.09.2026 um 11:45 Uhr)
IT NachrichtenSamsung Wallet: Neue Banken mit an Bord(21.09.2026 um 13:07 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

JavaScript Part-1

What is JavaScript? JavaScript (JS) is a high-level, interpreted, and versatile programming language used to make websites interactive and dynamic. It is one of the three core technologies of web development, alongside HTML and…

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

What is JavaScript?



JavaScript (JS) is a high-level, interpreted, and versatile programming language used to make websites interactive and dynamic. It is one of the three core technologies of web development, alongside HTML and CSS.




  • HTML creates the structure of a webpage.

  • CSS styles the webpage.

  • JavaScript adds behavior and functionality.






Variables



A variable is like a container that stores data.Imagine you have a box labeled Name. Inside that box, you store the value "Dharanidharan".



In JavaScript, variables work the same way—they store information that your program can use later.



Types of Variables



JavaScript provides three ways to declare variables:

let

const

var






1. let



The let keyword is used to declare a variable in JavaScript. It was introduced in ES6 (ECMAScript 2015) and is the recommended way to declare variables whose values may change during the execution of a program.



Syntax:

let variableName = value;




  • Reassigning a Variable-A variable declared with let can be reassigned.

  • Redeclaring is Not Allowed-You cannot declare the same variable twice in the same block.



Where Do We Use let?



The let keyword is used when the value of a variable may change during the execution of a program.Whenever you expect a variable to store different values at different times, let is the right choice.



Exzample



let y = 10;

console.log(y); // 10

let y = 20; // ❌ Error: Cannot redeclare

y = 20; // ✅ Allowed

console.log(y); // 20






2. const



The const keyword is used to declare a variable whose reference cannot be reassigned after it has been initialized. It was introduced in ES6 (ECMAScript 2015) and is the preferred choice for values that should remain the same throughout the program.



Syntax:

const country = "India";




  • const Must Be initialized Unlike let, you cannot declare a const variable without giving it a value.

  • both reassignment and redeclaration is not alowed.



where Do We Use Const?



The const keyword is used when a variable's reference should not be reassigned after it is created.Once a value is assigned to a const variable, you cannot assign a different value to that same variable.



Exzample



const z = 10;

z = 20; // ❌ Error: Assignment to constant variable

console.log(z); // 10






3. var(Not Recommended)



The var keyword was traditionally used to declare variables in JavaScript.Variables declared with var are function-scoped and can be re-declared within the same scope without causing an error.



Syntax:

var name = "ABCD";




  • Reassigning a Variable-A variable declared with var can be reassigned.

  • Redeclaring a Variable-One unique feature of var is that it can be redeclared in the same scope.



Why is var Not Recommended?




  • With var, you can declare the same variable multiple times in the same scope. This can accidentally overwrite values.

  • var is function-scoped, not block-scoped. This means a variable declared inside an if block or for loop is still accessible outside that block.

  • Variables declared with var are hoisted. They exist before the line where they are declared, but their value is undefined until the assignment happens.



Exzample



var x = 10;

var x = 20; // Redeclaration allowed

console.log(x); // 20



Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten JavaScript Part-1

Thematisch verwandte Begriffe: JavaScript, Part1 · 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-94040 | A flaw has been found in vas3k TaxHacker up to 0.8.5. Affected by this v…
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