Spread the love

In JavaScript, understanding variables and data types is crucial for effective programming. This knowledge forms the foundation for managing data and controlling program behavior.

Data Types In JavaScript
AspectDescription
VariablesContainers for storing data values.
Declaration Keywords– var: Function-scoped or globally-scoped.
– let: Block-scoped and reassignable.
– const: Block-scoped and immutable after assignment.

Data Types

Data TypeDescriptionExample
NumberRepresents both integer and floating-point numbers.let num = 42;
StringA sequence of characters enclosed in quotes.let str = "Hello, World!";
BooleanRepresents a logical entity with two values: true or false.let isActive = true;
NullRepresents the intentional absence of any value.let emptyValue = null;
UndefinedIndicates that a variable has been declared but not assigned a value.let notAssigned;
SymbolA unique and immutable primitive value used as an identifier.const sym = Symbol('description');
BigIntRepresents integers with arbitrary precision.const bigIntValue = BigInt(12345678901234567890);
ObjectA complex data type that can store collections of data.const person = { name: "John", age: 30 };
ArrayA special type of object used to store ordered collections.const fruits = ["apple", "banana", "cherry"];
FunctionFunctions are also objects and can be treated as first-class citizens.function greet() { return "Hello!"; }

Checking Data Types

MethodDescription
typeofReturns the type of a variable as a string.

Example Usage

javascriptconsole.log(typeof num); // "number"
console.log(typeof str); // "string"
console.log(typeof isActive); // "boolean"

This table provides a clear and organized overview of variables and data types in JavaScript, making it easy to reference key concepts at a glance!

Important Links

CompanyJob/InternshipLink
Wyreflow TechnologiesCareer PageLink
Agoda2025 Hiring (Closed Jobs)Link
L&THiring 2024 for FreshersLink
WiproOff Campus Recruitment Drive 2024Link
PM Internship Scheme2024 Registration Online GuideLink
TataSales Internship for Freshers (Stipend ₹7k)Link
MakerbleFullstack Developer InternshipLink
AtlassianInternship Openings 2025Link
ZenatixEntry-level Job Opportunities 2024Link
WorleyFresher Vacancies 2024Link
WiproOff Campus Recruitment Drive 2024Link
GoogleOff Campus Drive 2024Link
American ExpressOff Campus Drive 2024Link
AmazonEntry Level Jobs 2024Link
GoogleInternship Openings 2025Link

techbloggerworld.com

Nagendra Kumar Sharma I Am Software engineer

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *