Some Basic things in JavaScript

JavaScript is a programming language. It is designed to run as a scripting language in a host environment, JavaScript is a multi-paradigm, dynamic language with types and operators, standard built-in objects, and methods. Its syntax is based on the Java and C languages .In JavaScript, an object is an associative array, augmented with a prototype (see below); each key provides the name for an object property, and there are two syntactical ways to specify.JavaScript was created in 1995 by Brendan Eich at Netscape.

Netscape management soon decided that the best option was for Eich to devise a new language, with syntax similar to Java and less like Scheme or other extant scripting languages.JavaScript was first released with Netscape 2 early in 1996.

Several months later, Microsoft released JScript with Internet Explorer 3.

String is basically an object that represents sequence of char values.

The String object is used to represent and manipulate a sequence of characters.

They are useful for holding data that can be represented in text form.


The charAt() method returns the character at the specified index in a string.The index of the first character is 0, the second character is 1. If the index you supply is out of this range, JavaScript returns an empty string.


The concat() method is used to join two or more strings.This method concatenates the string arguments to the calling string and returns a new string.It does not change the existing strings, but returns a new string containing the text of the joined strings.


The endsWith () method determines whether a string ends with the characters of a specified string.This method returns true if the string ends with the characters, and if not.


The includes() method determines whether a string contains the characters of a specified string.This method returns whether one string may be found within another string, returning true or false as appropriate.

Index Of ( ):

The indexOf() method returns the position of the first occurrence of a specified value in a string.

This method returns -1 if the value to search for never occurs.

The index of the first occurrence of searchValue, or -1 if not found.

Replace( ):

The replace() method searches a string for a specified value, or a regular expression, and returns a new string where the specified values are replaced.This method does not change the original string.


The slice() method extracts parts of a string and returns the extracted parts in a new string.slice() extracts up to but not including endIndex.Changes to the text in one string do not affect the other string.

Split( ):

Split a string into an array of substrings.This method divides a string into an ordered list of substrings, puts these substrings into an array, and returns the array.

StartsWith( ):

The startsWith() method determines whether a string begins with the characters of a specified string.This method returns true if the string begins with the characters, and false if not.This method determines whether or not a string begins with another string.

toLowerCase( ):

The toLowerCase() method converts a string to lowercase letters.In this method a new string representing calling string converted to lower case.Here the value of the string converted to lower case. And the toLowerCase() method does not change the original string.

Web Developer