# How does literals in compiled languages differ from literals in interpreted languages?

A literal is a piece of data which gets its value at compile time.

Means: Becomes set at compile time and afterward the value is fixed incorporated into the machine code as a code consisting out of 0s and 1s.

What are literals in interpreted languages like for example JavaScript?

As far as I know the code within JavaScript functions aren't touched by the interpreter until it becomes executed.

Can one say that literals exists in these languages? regarding my definition of a literal (first paragraph).

I don't think that's a good definition of literals. A literal is a source-code token that represents a fixed value of some type. For example, in almost all programming languages, 23 is a literal representing the integer twenty-three. These aren't pieces of data that get their value at compile-time: rather, they are representations of the values themselves. For example if, in Java, you write
static final int magic = 23;

then magic is a constant (a variable whose value cannot be changed) that is set at compile-time to have the value twenty-three, which is the meaning of the literal 23.