THE JAVASCRIPT LANGUAGE

INTRODUCTION TO JAVASCRIPT LANGUAGE

INTRODUCTION TO JAVASCRIPT Javascript is a scripting language, single thread, conforming to the ECMAScript specification that can operate both client-side and server-side and is compiled and interpreted. A scripting language is a language that needs to be executed within a pre-existing entity in order to operate. In the case of javascript, the entity is the web browser. Single Thread. Imagine a post office with a single operator who has to serve n customers. What the operator can do however fast is to serve one person at a time. People in the queue must wait for the [...]

By |2024-11-11T18:15:18+00:00January 7, 2022|0 Comments

OUTPUT IN JAVASCRIPT

JAVASCRIPT OUTPUT We introduce the "Output in Javascript" argument by saying that JavaScript can "display" data in several ways: Write in an HTML element, using innerHTML Write to the HTML output using document.write () Write to an alert window, using window.alert () By writing to the browser console, using console.log () INNERHTML To access an HTML element, JavaScript can use the document.getElementById(id) method. The id attribute defines the HTML element. The innerHTML property defines the HTML content. OUTPUT IN JAVASCRIPT THE METHOD DOCUMENT.WRITE For testing purposes, it is convenient to use document.write(). Using document.write () after [...]

By |2024-11-11T18:16:32+00:00January 9, 2022|0 Comments

JAVASCRIPT SYNTAX

JAVASCRIPT STATEMENT In this post we will discuss variables declared can var or let while also taking a look at the nomenclature commonly used by programmers for variable naming. Let us introduce the topic regarding the "Javascript syntax" by talking first about statements (instructions). let a, b, c; // Statement 1 a = 5; // Statement 2 b = 6; // Statement 3 c = a + b; // Statement 4 The statement (instruction) let a, b, c declares three variables. A program is a list of "statements" that are to be "executed" by a computer. In HTML, JavaScript [...]

By |2024-11-11T18:17:15+00:00January 12, 2022|0 Comments

VALUES AND VARIABLES IN JAVASCRIPT

VALUES AND VARIABLES IN JAVASCRIPT In this introductory part, some concepts are repeated. It is useful to fix well what are the basic elements of language. Values are fundamental units of any program. To understand what a value is, let's take a culinary example. To make a dish we need various ingredients that properly combined together provide us with the desired dish. Similarly in javascript we need a whole set of information units which are the values, without the values it is as if we want to prepare that delicious dish but without having the ingredients available. VARIABLES The [...]

By |2024-11-11T18:17:53+00:00January 15, 2022|0 Comments

JAVASCRIPT OPERATORS

JAVASCRIPT OPERATORS Before we begin, let us understand the terminology. An operand - is what the operator applies to. For example, in multiplication 5 * 2 there are two operands: the left operand is the number 5, and the right operand is the number 2. Sometimes operands are also called "arguments." An operator is unary if it has a single operand. For example, negation-reverses the sign of a number: let x = 1; x = -x;alert( x ); // -1, unary negation is applied An operator is binary if it has two operands. The same "minus" operator exists in [...]

By |2024-11-11T18:18:49+00:00January 30, 2022|0 Comments

PRIMITIVE VALUES AND JAVASCRIPT OBJECTS

PRIMITIVE VALUES AND OBJECTS In javascript there are several types of values that are divided into primitives and objects. Definition: An object is a data structure that allows the storage of a set of information. We will look at primitive data one by one. Let's go to Visual Studio Code. JAVASCRIPT OBJECTS NB: This is only an overview. We will delve into the discussion of javascript objects in later posts. In JavaScript there are eight types of data. Seven of them are called "primitives" because their values always contain a single element [...]

By |2024-11-11T18:19:25+00:00February 13, 2022|0 Comments

THE TYPE NUMBER AND OTHER PRIMITIVE DATA IN JAVASCRIPT

NUMBERS IN JAVASCRIPT Number with the ES2019 specification is the only type associated with numbers. We do not have the float type for decimal numbers. Numbers in javascript are represented according to the IEEE 754 floating point 64-bit standard. Every number even integers are represented and stored in memory as 64-bit floating point numbers. THE SCIENTIFIC OR EXPONENTIAL NOTATION Any number can be represented with scientific notation (also called exponential): mantissa*base exponent The mantissa are the significant figures, excluding zero; the base is ten because we are in the decimal system. For example, a number we [...]

By |2024-11-11T18:20:04+00:00November 8, 2022|0 Comments

JAVASCRIPT STRINGS

STRINGS IN JAVASCRIPT A string in javascript is an unsigned 16-bit immutable sequence of elements. Each element in most cases represents a Unicode character. This rule does not always apply, I give an example of code where in the case of an emoji you need two bytes. ES2015 introduced literal templates. We can define a string through the backtick character. To define the backtick we use: Alt Gr + on Linux Alt+96 on Windows Alt +9 on Mac Strings are used to store and manipulate text. A string consists of zero or more characters [...]

By |2024-11-11T18:20:40+00:00February 20, 2022|0 Comments

CONDITIONAL STRUCTURES IN JAVASCRIPT

CONDITIONAL STRUCTURES Javascript like other languages provides conditional structures. The conditional is always present in everyday life, let us analyze the following sentence that can be true or false as shown in the image below. The "conditional structures in javascript" are statements that are used to perform different actions for different conditions. Very often, when writing code, you want to execute different actions for different decisions. You can use conditional statements in the code to perform this operation. In JavaScript we have the following conditional statements: Use if to specify a block of code [...]

By |2024-11-11T18:21:16+00:00March 8, 2022|0 Comments

LOOPS IN JAVASCRIPT

LOOPS IN JAVASCRIPT CYCLE FOR Loops can execute a block of code a certain number of times. They are useful if you want to run the same code over and over again. LOOP TYPES. JavaScript supports several types of loops: for - runs a block of code a number of times for/in - scrolls the properties of an object for/of - scrolls the values of an iterable object while - runs a block of code while a specified condition is true do/while - variant of the while loop. It also scrolls a block of code while a specified condition [...]

By |2024-11-11T18:21:55+00:00March 13, 2022|0 Comments
Go to Top