BASIC JAVASCRIPT TERMINOLOGY
This complete note explains the most important beginner terms in JavaScript in simple language.
The goal is not only to memorize words, but also to understand how they work in real code.
1. What is programming?
Programming is the process of writing instructions for a computer.
There are many programming languages in the world, for example:
- JavaScript
- Python
- Java
- C++
- PHP
Programming languages are not like human languages in every way, but they do have some similarities.
Human languages have:
- words
- rules
- sentence structure
Programming languages also have:
- words
- symbols
- rules
- structure
In human language, syntax explains how words are put together correctly.
In programming, syntax explains how code must be written correctly.
For example, syntax tells us:
- where to write
; - where to use
: - when to use
"",'', or backticks` - what order words and symbols must follow
Syntax is very important. Even a small mistake can stop the program from running.
2. What is code?
Code is a set of instructions that a computer can understand and execute.
A programmer writes code to tell the computer what to do.
Examples of things code can do:
- calculate numbers
- show text
- check user input
- react to clicks
- save data
- change a webpage
Every programming language has its own rules. A piece of code that works in Python may not work in JavaScript.
3. What is source code?
Source code is the text of a program written by a developer in a programming language.
Example of source code in JavaScript:
console.log("Hello");
This is readable for people who know JavaScript, but the computer does not work with source code directly in the same way humans read it.
Before the machine can execute it, the code must be processed.
This is done by:
- a compiler
- or an interpreter
These are special programs that convert or read source code and make it understandable to the computer.
Source code should do two things:
- solve the problem correctly
- stay understandable for the developer or for another person who will edit it later
Good code is not only correct. Good code is also readable.
4. Programming is also logic and problem solving
Programming is not only about typing code.
A big part of programming is:
- thinking logically
- solving problems
- breaking a big task into smaller steps
Experienced developers often think in terms of algorithms.
5. What is an algorithm?
An algorithm is a sequence of steps used to reach a goal.
We use algorithms in everyday life too.
Example: making tea
- Boil water
- Measure the tea
- Put the tea into a container
- Pour in the hot water
- Wait 5 minutes
This is an algorithm because it has a clear order of steps.
The same idea is used in programming.
When creating a program, the general algorithm is usually:
- break the task into smaller parts
- decide the correct order of actions
- use the right tools to solve each part
Diagram 1. From problem to program
1. Problem
↓
2. Break into small tasks
↓
3. Create an algorithm
↓
4. Write code
↓
5. Run the code
↓
6. Get the result
6. What is JavaScript?
JavaScript is a high-level programming language supported by all modern web browsers.
It is one of the main languages of web development.
Important: JavaScript and Java are not the same language. They are completely different programming languages.
7. What JavaScript is used for
In front-end development, JavaScript works together with:
- HTML - structure of the webpage
- CSS - style and design of the webpage
- JavaScript - behavior and functionality
JavaScript can do many things on a webpage, for example:
- make calculations
- check data entered by the user
- change page content dynamically
- react to clicks and keyboard actions
- store information in the browser
- create interactive elements like galleries or charts
- communicate with the backend
Important note
When JavaScript runs in the browser, it does not have full access to the computer's file system or operating system. This restriction exists for security reasons.
8. JavaScript is not only for the browser
Today JavaScript can be used in many areas:
- Front-end development in the browser
- Web applications with frameworks like React, Vue, and Angular
- Backend development with Node.js
- Mobile apps with React Native
- Desktop apps with Electron
So JavaScript is a very important language for full stack development.
Diagram 2. Where JavaScript can be used
1. Browser → front-end
2. Node.js → backend
3. React Native → mobile apps
4. Electron → desktop apps
5. Frameworks → full web applications
9. What is a statement?
A statement is a complete instruction written in code.
You can think of a statement like a sentence in human language.
Example:
a = b * 2;
This is one statement.
In JavaScript, statements often end with a semicolon:
;
The semicolon is similar to a period at the end of a sentence.
In the example:
a = b * 2;
aandbare variables2is a number=and*are operators
10. What is a variable?
A variable is a named place where data is stored.
A variable has:
- a name (identifier)
- a value
For example, if b is 10, then:
a = b * 2;
means:
- take the value from
b - multiply it by
2 - save the result into
a
So if:
b = 10;
then after this statement:
a = b * 2;
the value of a becomes:
20
Diagram 3. How a = b * 2; works
1. Find the value of b
b = 10
2. Calculate b * 2
10 * 2 = 20
3. Save the result in a
a = 20
11. What is an operator?
An operator is a symbol that performs an action.
Examples:
=→ assignment*→ multiplication+→ addition-→ subtraction/→ division
In this code:
a = b * 2;
*multiplies=assigns the result toa
12. What is an expression?
An expression is a part of code that produces a value.
Expressions can be:
- a value
- a variable
- several values and variables combined with operators
Example:
a = b * 2;
This statement contains several expressions.
Expressions inside it
2→ a literal value expressionb→ a variable expressiona→ a variable expressionb * 2→ a multiplication expressiona = b * 2→ an assignment expression
The most important idea is this:
A statement is a full instruction. An expression is a smaller part inside the statement.
13. What is a literal?
A literal is a value written directly in code.
It is called "literal" because the value is written exactly as it is, not taken from a variable.
Numeric literal
10
This is a number written directly in code.
String literal
"JavaScript is awesome!"
This is a string written directly in code.
Literals are used when we want to write a specific value directly.
14. Types of literals in this note
1. Numeric literal
25
2. String literal
"Hello"
A string is text inside quotation marks.
Diagram 4. Variable vs literal
1. Literal
"Hello"
10
2. Variable
name that stores a value
Example:
let age = 25;
age → variable
25 → literal
15. Connecting JavaScript to HTML
To use JavaScript on a webpage, we connect it with the <script> tag.
There are two common ways:
- embedded script
- external script
16. Embedded script
An embedded script means the JavaScript code is written directly inside the HTML file.
Example:
<!DOCTYPE html>
<html>
<head>
<title>My HTML page</title>
<script>
console.log("Hello, world");
</script>
</head>
<body>
</body>
</html>
Here, the JavaScript code is inside the <script> tag.
When this is useful
Embedded scripts are okay for:
- very small examples
- learning
- quick testing
But usually not the best choice for big projects
In real projects, large scripts inside HTML can make code harder to read and maintain.
17. External script
An external script means the JavaScript code is written in a separate file with the .js extension.
Example HTML:
<!DOCTYPE html>
<html>
<head>
<title>My HTML page</title>
<script src="my-script.js" defer></script>
</head>
<body>
</body>
</html>
Example JavaScript file my-script.js:
console.log("Hello from external file");
Here:
src="my-script.js"tells the browser where the JS file isdefertells the browser to run the script after the HTML is loaded
18. What does defer do?
The defer attribute tells the browser:
- load the JavaScript file
- wait until the HTML document is fully loaded
- then run the JavaScript
This is useful because it helps the page load more smoothly.
Without defer, JavaScript may run too early.
Example
If JavaScript tries to work with an HTML element before that element exists on the page, there can be an error.
So defer is often a very good idea.
Diagram 5. How an external script with defer works
1. Browser starts loading HTML
2. Browser sees <script src="file.js" defer>
3. Browser continues loading HTML
4. HTML finishes loading
5. JavaScript runs
19. Where to place the <script> tag
When using defer, the <script> tag can be placed:
- in
<head> - or in
<body>
In this case, there is no important difference.
20. Why external scripts are usually better
External scripts are usually preferred because they make code:
- cleaner
- easier to read
- easier to maintain
- reusable in multiple pages
This is the standard way in real projects.
21. Live reload in VSCode
If you use VSCode with the Live Server extension, the webpage reloads automatically when you save changes in your script file.
This is very useful during development because you can quickly see the result of your changes.
22. What is strict mode?
Strict mode is a special JavaScript mode that makes the language safer and more modern.
It helps prevent certain mistakes and blocks some old or unsafe behaviors.
To enable strict mode, write this at the beginning of the script:
'use strict';
Example:
'use strict';
console.log("Strict mode is on");
Why strict mode is useful
It helps you:
- avoid some common mistakes
- write more reliable code
- follow modern JavaScript rules
- maintain code more easily
It is a good habit to use strict mode in your projects.
Diagram 6. Why strict mode is useful
1. You enable strict mode
2. JavaScript checks code more carefully
3. Some bad or old patterns are not allowed
4. Your code becomes safer and easier to maintain
23. Outputting data
When writing code, a developer often needs to check:
- what value a variable has
- whether a line of code runs
- whether the program behaves correctly
A common tool for this is the browser console.
The console is in the browser's developer tools.
You usually open it on the Console tab.
Shortcuts
- Windows / Linux:
Ctrl + Shift + J - macOS:
Command + Option + J
24. console.log()
The console.log() method prints data to the developer console.
Syntax:
console.log(value);
Whatever is inside the parentheses will be shown in the console.
Example 1
console.log("JavaScript is awesome!");
Output in console:
JavaScript is awesome!
Example 2
console.log(10);
Output in console:
10
Example 3
let name = "Nikita";
console.log(name);
Output:
Nikita
25. Why console.log() is important
console.log() is one of the first tools every JavaScript developer learns.
It is useful for:
- debugging
- checking values
- understanding program flow
- testing small ideas
Example:
let a = 5;
let b = 10;
let result = a + b;
console.log(result);
Output:
15
This helps you see whether your code works as expected.
Diagram 7. How console.log() helps
1. Write code
2. Print a value with console.log()
3. Open the console
4. Check the result
5. Fix the code if needed
26. Why semicolons matter in your tasks
In modern JavaScript, semicolons are sometimes omitted in real projects, depending on code style.
But in your learning tasks and auto-check systems, you should always use semicolons.
Example:
console.log("Hello");
This is safer for beginner tasks because some auto-checkers expect semicolons and may fail without them.
So for learning platforms and auto-check tasks:
always end the line with ;
27. What are tests in an auto-checker?
In coding platforms, under a task you may see a section called Tests.
These are automatic checks.
They verify whether your solution matches the task requirements.
After you click Check, the system runs tests automatically.
What tests do
They check things like:
- did you write the correct code?
- is the output correct?
- did you follow the task rules?
- did you use the expected syntax?
So if a task says there are tests, that is normal. It is just the system checking your answer.
Diagram 8. How the auto-checker works
1. You write code
2. You click "Check"
3. The system runs tests
4. The system compares your code with the task rules
5. You get the result
28. Full example: reading code correctly
Let's look again at this statement:
a = b * 2;
Suppose:
b = 10;
Then JavaScript works like this:
- find the current value of
b - replace
bwith10 - calculate
10 * 2 - get
20 - save
20intoa
Final result:
a = 20;
This is a very important beginner idea:
- the right side is calculated first
- then the result is assigned to the left side
29. Mini summary of key terms
Programming
Writing instructions for a computer.
Syntax
Rules for writing code correctly.
Code
Instructions written for the computer.
Source code
The text of a program written by a developer.
Compiler / Interpreter
Programs that process source code so the computer can execute it.
Algorithm
A sequence of steps used to solve a problem.
JavaScript
A programming language used in browsers and many other areas.
Statement
A complete instruction in code.
Variable
A named place for storing data.
Operator
A symbol that performs an action.
Expression
A part of code that produces a value.
Literal
A value written directly in code.
<script>
HTML tag used to connect JavaScript.
defer
Runs the script after HTML is loaded.
Strict mode
A safer and stricter execution mode in JavaScript.
console.log()
Prints data to the browser console.
Tests
Automatic checks used by learning platforms or auto-checkers.
30. Simple beginner examples
Example 1: numeric literal
console.log(100);
Example 2: string literal
console.log("Hello, JavaScript");
Example 3: variable and expression
let b = 10;
let a = b * 2;
console.log(a);
Result:
20
Example 4: strict mode
'use strict';
console.log("My script is running");
Example 5: external script in HTML
<script src="main.js" defer></script>
31. Important beginner ideas to remember
- JavaScript is one of the main languages for web development.
- Syntax matters a lot. Even a small mistake can break the code.
- A statement is a full instruction.
- An expression is a smaller part inside the statement.
- A literal is a value written directly in code.
- Variables store values.
console.log()is very useful for learning and debugging.- External scripts are usually better than embedded scripts.
deferhelps load scripts at the right time.- Strict mode is a good habit.
32. Final conclusion
JavaScript terminology may look difficult at first, but the ideas are actually very logical.
When you learn JavaScript, try to read code like a system of small steps:
- What is the instruction?
- What values are used?
- What operation happens?
- Where does the result go?
This way of thinking will help you not only in JavaScript, but in full stack development in general.
The more examples you read and write, the easier these terms will become.
33. Short revision block
Programming = writing instructions for a computer
Syntax = rules of the language
Code = instructions
Source code = program text written by a developer
Algorithm = step-by-step solution
Statement = full instruction
Expression = part of instruction that gives a value
Variable = named storage
Literal = direct value in code
Operator = symbol that performs an action
console.log() = print to console
<script> = connect JavaScript to HTML
defer = run script after HTML is loaded
'use strict'; = safer JavaScript mode
Tests = automatic checks in tasks