Menu

1 / 2

Javascript- literals and keywords

DEV Community·sai sanjana·6 months ago
#6GlBqjMk
#javascript#beginners#learning#java#keywords
Reading 0:00
15s threshold

Hi all,

--JavaScript Literals

Literals are the simplest way to represent values in JavaScript. They are written directly into the program without needing computation.

Types of Literals

Number literals: Represent numeric values. Example: 42, 3.14.

String literals: Text enclosed in quotes. Example: "Hello", 'World'.

Boolean literals: Logical values true or false.

Null literal: Represents an empty or non-existent value. Example: null.

Undefined literal: Indicates a variable has been declared but not assigned.

Object literals: Define objects directly.

Array literals: Define lists of values.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.