DEV Community

Karthick (k)
Karthick (k)

Posted on

JavaScript Introduction

Q1.ASCII Values Alphabets ( A-Z, a-z & Special Character Table )

ASCII (American Standard Code for Information Interchange) is a character encoding standard that assigns unique numeric values to letters, digits, punctuation marks and symbols. Since computers work only with binary data (0s and 1s), ASCII acts as a bridge by converting human-readable characters into machine-readable numbers.

Q2.Binary Number System

The Binary Number System, also known as the base-2 system, uses only two digits, '0' and '1', to represent numbers. It forms the fundamental basis for how computers process and store data. This base-2 system is the backbone of how computers process and store information, representing everything from text to images as sequences of 0s and 1s.

Q3 Compiler and Interpreter

Compiler:

A compiler is a software program that transforms high‐level source code that is written by a developer in a high‐level programming language into low-level object code (binary code) in machine language, which can be understood by the processor. The process of converting high‐level programming into machine language is known as compilation.

Interpreter:

An interpreter transforms or interprets a high‐level programming code into code that can be understood by the machine (machine code) or into an intermediate language that can be easily executed as well. The interpreter reads each statement of code and then converts or executes it directly.

Q4.What is a byte?

In most computer systems, a byte is a unit of data that is eight binary digits long. A byte is the unit most computers use to represent a character, such as a letter, number or typographic symbol.

Q5.Introduction to JavaScript

JavaScript is a versatile, dynamically typed programming language that brings web pages to life by making them interactive. It is used for building interactive web applications and supports both client-side and server-side development.

  1. Interpreted language: Code is executed line by line.
  2. Dynamically typed: Variable types are determined at runtime.
  3. Single-threaded: Executes one task at a time (but supports asynchronous operations).

Q6.JavaScript Variables

Variables in JavaScript are used to store data values. They can be declared in different ways depending on how the value should behave.

  • Variables can be declared using var, let, or const.
  • JavaScript is dynamically typed, so types are decided at runtime.
  • You don’t need to specify a data type when creating a variable

Declaring Variables in JavaScript

  • ES6 Introduction: let and const were introduced to provide safer alternatives for declaring variables.
  • Scope: let and const are block-scoped (limited to { } block) or global-scoped, reducing errors compared to var.
  1. var keyword var is a keyword in JavaScript used to declare variables; it is Function-scoped and hoisted, allowing redeclaration, but it can lead to unexpected bugs.

var a = "Hello Geeks";
var b = 10;
console.log(a);
console.log(b);

  1. let keyword

let is a keyword in JavaScript used to declare variables,and it is Block-scoped and not hoisted to the top, suitable for mutable variables

let a = 12
let b = "gfg";
console.log(a);
console.log(b);

  1. const keyword

const is a keyword in JavaScript used to declare variables, and it is Block-scoped, immutable bindings that can't be reassigned, though objects can still be mutated.

const a = 5
let b = "gfg";
console.log(a);
console.log(b);

Q7.Core Key Features of ES6

ES6, which stands for ECMAScript 6, is the sixth major edition of the ECMAScript standard that defines how JavaScript works. Released in June 2015 and officially named ECMAScript 2015, it introduced the most significant syntax updates and features to JavaScript since its inception

Top comments (0)