E-Learn Knowledge Base


Vsasf Tech ICT Academy, Enugu in early 2025 introduced a hybrid learning system that is flexible for all her courses offered to the general public. With E-learn platform powered by Vsasf Nig Ltd, all students can continue learning from far distance irrespective of one's location, hence promoting ODL system of education for Nigerians and the world at large.

Students are encouraged to continue learning online after fully registered through the academy's registration portal. All fully registered students with training fee payment completed can click on the login link Login to continue to access their course materials online

Variables and Datatypes in JavaScript

Variables and data types are foundational concepts in programming, serving as the building blocks for storing and manipulating information within a program. In JavaScript, getting a good grasp of these concepts is important for writing code that works well and is easy to understand.

Variables

In JavaScript, variables are used to store and manage data. They are created using the var, let, or const keyword.

1. var Keyword

The var keyword is used to declare a variable. It has a function-scoped or globally-scoped behavior.

var x = 10;

Example: In this example, we will declare variables using var.

 

JavaScript
var a = "Hello Vsasf"
var b = 10;
var c = 12;
var d = b + c;

console.log(a);
console.log(b);
console.log(c);
console.log(d);
 

Output
Hello Vsasf
10
12
22

2. let Keyword

The let keyword is a block-scoped variables. It’s commonly used for variables that may change their value.

let y = "Hello";

Example: In this example, we will declare variables using let.

JavaScript
 
 
 
 
 
 
 
1
let a = "Hello learners"
2
let b = "joining";
3
let c = " 12";
4
let d = b + c;
5
6
console.log(a);
7
console.log(b);
8
console.log(c);
9
console.log(d);
 
 
 
 
 


Output
Hello learners
joining
 12
joining 12

const Keyword

The const keyword declares variables that cannot be reassigned. It’s block-scoped as well.

const PI = 3.14;

Example: In this example, we will declare the variable using the const keyword.

 
JavaScript
 
1
const a = "Hello learners"
2
console.log(a);
3
4
const b = 400;
5
console.log(b);
6
7
const c = "12";
8
console.log(c);
9
// Can not change a value for a constant
10
// c = "new"
11
// console.log(c) will show error
Output
Hello learners
400
12

Data Types

JavaScript is a dynamically typed (also called loosely typed) scripting language. In JavaScript, variables can receive different data types over time. The latest ECMAScript standard defines eight data types Out of which seven data types are Primitive (predefined) and one complex or Non-Primitive.

Primitive Data Types

The predefined data types provided by JavaScript language are known as primitive data types. Primitive data types are also known as in-built data types.

  1. Number: JavaScript numbers are always stored in double-precision 64-bit binary format IEEE 754. Unlike other programming languages, you don’t need int, float, etc to declare different numeric values.
  2. String: JavaScript Strings are similar to sentences. They are made up of a list of characters, which is essentially just an “array of characters, like “Hello GeeksforGeeks” etc.
  3. Boolean: Represent a logical entity and can have two values: true or false.
  4. Null: This type has only one value that is null.
  5. Undefined: A variable that has not been assigned a value is undefined.
  6. Symbol: Symbols return unique identifiers that can be used to add unique property keys to an object that won’t collide with keys of any other code that might add to the object.
  7. BigInt: BigInt is a built-in object in JavaScript that provides a way to represent whole numbers larger than 2^53-1.

Non-Primitive Data Types

The data types that are derived from primitive data types of the JavaScript language are known as non-primitive data types. It is also known as derived data types or reference data types.

  • Object: It is the most important data type and forms the building blocks for modern JavaScript. We will learn about these data types in detail in further articles.

FAQs – Variables and DataTypes in JavaScript

What are the different data types in JavaScript?

JavaScript has several basic data types including string, number, boolean, undefined, null, symbol, and bigint. There are also complex data types like object, which includes arrays and functions.

How do you declare a variable in JavaScript?

In JavaScript, you can declare a variable using var, let, or const. let and const were introduced in ES6 and are preferred over var because of their block-scoping and other advantages.

What is the difference between let, var, and const in JavaScript?

var is function-scoped, while let and const are block-scoped. let allows you to reassign a value to a variable, while const does not, meaning variables declared with const cannot be reassigned after their initial assignment.

What is the difference between null and undefined in JavaScript?

undefined means a variable has been declared but has not yet been assigned a value. null is an assignment value that represents “no value” or “empty”.

How can you check the data type of a variable in JavaScript?

You can use the typeof operator to determine the data type of a variable in JavaScript. For example, typeof 42 returns “number”, and typeof “hello” returns “string”.

Authors: T. C. Okenna
Register for this course: Enrol Now

What is Computer Programming?

In today's world, we are all heavily reliant on various software products that were carefully programmed by developers. But what is computer programming?

In this article, I will provide a definition of programming, as well as examples of different types of programmers. I will also suggest a list of courses you can take to start learning how to code.

Definition of programming

A computer program consists of code that is executed on a computer to perform particular tasks. This code is written by programmers.

Programming is the process of giving machines a set of instructions that describe how a program should be carried out. Programmers will spend their whole careers learning a variety of programming languages and tools so they can effectively build computer programs.

Programmers will start by using a code editor or IDE to write what is called source code. This is a collection of code written in a programming language that other programmers can read.

Source code needs to be converted into machine language so machines can understand the instructions and execute the program. This process of converting source code into machine language is known as compiling.

Examples of compiled programming languages would be C and C++.

There are other languages that do not use compilers. Instead, these languages will use an interpreter that will read and execute the code.

Examples of interpreted programming languages would be JavaScript and PHP.

Once the code is executed, then the computer program can run. The different types of computer programs include Word processors, Database systems, video games, and websites.

These computer programs allow us to interactive with different software devices and services like phones, websites, and the computers themselves.

History of Programming

Many historians believe Ada Lovelace was the first to create a published computer program in the mid 19th century. She was a mathematician who translated Luigi Federico Menabrea's writings on the Analytical Engine.

In this translation, Ada had added her own extensive notes and created a method for calculating Bernoulli numbers for the Analytical Engine.

The work of mathematician Alonzo Church as well as the Turing machine were the first introductions of computer codes.

In the 1920's, computers were created which was followed by the earliest programming languages. For the next century, as machines and technology continued to evolve, so did the number of programming languages.

Types of programming languages

There are hundreds of programming languages in existence. Developers will first consider the needs of the application so they can decide which languages would be appropriate to use.

Here are a few popular programming languages.

  • Python
  • JavaScript
  • C/C++
  • Java
  • C#
  • Ruby
  • PHP

Some of these languages are primarily used in one field of development while others are more general purpose programming languages.

JavaScript is primarily used in web development and is usually the first programming language learned by beginner web developers. JavaScript can also be used for mobile and game development.

Python can be used in a variety of areas like data analysis, machine learning, and web development.

Programming languages are grouped in a variety of categories. Here is a list of some of the categories.

  • Machine language – a low level language that consist of 0's and 1's (binary). High level languages are compiled into machine code so the code can be executed by the computer.
  • Assembly language – a low level language that is compiled by an assembler. Assemblers translate human code to machine code.
  • Procedural languages – this approach goes through a series of procedures before a program is executed on the computer. (For example, Go and Julia)
  • Scripting languages – these languages often times don't need to be compiled but rather interpreted. Interpreted means an interpreter will read and execute the code instead of being compiled into machine code. (For example, JavaScript and PHP)
  • Functional languages – this works with the idea of building complex programs through a collection of smaller functions. (For example, Haskell and Scala)
  • Object-oriented languages – this works with the idea of building programs around collections of objects. (For example, Java and Python)

There are many more software paradigms and languages to explore that we didn't cover in this article. But this should give you a good start into the various types of programing languages out there.

Types of programming jobs

There are many types of programming jobs that you can choose from. This article will just focus on a few areas.

Web developer

These types of programmers build applications for the web. They will work with languages like HTML, CSS, JavaScript, PHP, Python, and more.

There are plenty of courses that you can take online to teach yourself. You can also go through a bootcamp which entails months of intensive study.

Salaries will differ between locations but they tend to be high paying jobs.

Mobile developer

These types of developers build applications for mobile devices. Programming languages will include React Native, Swift, Flutter, Java, and Kotlin.

There are plenty of courses that you can take online to teach yourself. Salaries will differ between locations but they tend to be high paying jobs.

Game Development

These programmers will build custom games for mobile, desktop and game console use. Programming languages can include, C++, C# and Lua.

These programmers will work for small independent game studios as well as larger international companies like Sony.

There are plenty of courses that you can take online to teach yourself. Salaries will differ between locations but they tend to be high paying jobs.

Computer Systems Engineer

This profession combines computer science and engineering to work on complex business applications. Programming languages will include Python, Java and C++.

The typical educational path would be a formal bachelor's degree in computer science. Salaries will tend to be in the six figures.

Skills programmers should have

A professional programmer will have a variety of responsibilities when it comes to building computer programs.

Here are some of the important skills needed in programming.

  • Writing clean and efficient code
  • Problem solving
  • Testing applications
  • Fixing errors ("bugs") in the code
  • Good communication and listening skills
  • Ability to work well within a team
  • Patience and perseverance

It is the job of a programmer to take the needs of the client and create a solid working application. Developers will spend a lot of time researching, building, fixing and testing their code.

After the application is released, developers will spend time maintaining the product and working to make it better.

Conclusion

Computer programming can be a very rewarding career both intellectually and financially. Programmers need to be willing to learn new things and solve complex problems.

There are many different fields of programming to explore like Web, mobile, game development or systems engineer. Some fields will require formal education while others are open to self taught programmers.

I hope you enjoyed this article and best of luck on your programming journey.

Authors: Jessica Wilkins, T. C Okenna
Register for this course: Enrol Now
Page 1 of 1