By sorting, we simply mean to arrange items in a particular order. The items may be placed alphabetically, increasingly or decreasingly. The words can be arranged alphabetically whereas numbers can be arranged in increasing or decreasing order.
Author: Ajay
How to search an array in JavaScript?
As you know an array is a list of elements which can be numbers, text etc. You may have the situations when you need to search an element in your array list. To do that, JavaScript provides different methods to search elements in an array list.
Arrays in JavaScript
The array object allows you to store multiple values in one variable. It stores data in sequence form having same type. JavaScript arrays can store any valid value, including strings, numbers, objects, functions, and even other arrays, thus making it possible to create more complex data structures such as an array of objects or an array of arrays.
Switch case in JavaScript
The switch case is an alternative of if…else statement which does almost the same thing. The switch case statement tests a variable against a series of values until it finds its match.
If-else or conditional statements in JavaScript
When you write a code for developing your web page, you may have the situations where you want to handle some statements of your code with some conditions.
JavaScript Operators
Operators are the basic building blocks of any programming language. Like other programming languages, JavaScript also has built in operators which are used to make number calculations, assign values etc. These are the symbols which tell the JavaScript engine to perform calculations like addition, subtraction, division, multiplication, assigning vales to the variables.
JavaScript Data types
Data types are the basic building blocks of any programming language. Like other computer languages, JavaScript has built in data types which are used to build your program. Data types specify what type of data can be stored in your program.
Generating JavaScript Outputs
There are certain situations where you want to generate output of your program as per your requirement. Sometime, you might want to see the value of variable, or write a message to browser console to help you debug an issue in your running JavaScript code, and so on.
JavaScript variables
A variable is fundamental for any language. Like C, C++ and other programming language JavaScript also allow you to declare variables. A variable is nothing but a storage which holds your data. It can be simply compared with containers in your house’s kitchen which are used to store different items.
JavaScript syntax
The syntax of JavaScript is the set of rules that defines correctly structured JavaScript program. The statements which JavaScript program consists are placed inside HTML tags. The JavaScript file is saved with a.js extension.