Introduction to JavaScript : Built-in Functions

Built-in Functions

JavaScript has many different built-in functions which ease the process of coding. Built-in functions are pre-coded functions that are readily available to use in one's project. 

Examples are as below: 

  • toExponential() - It displays a number in the form of an exponent 
  • toFixed() - Defines the number of digits to the right of a decimal number
  • toLocaleString() - Returns the string value of a number 
  • toPrecision() - Define the total numbers of a digit to be displayed after the decimal point
  • valueOf() - Returns the actual value of a number 
  • charAt() - Returns the value of a character at a specific index 
  • concat() - Concatenates or appends two strings to produce a new string 
  • length() - Returns the total length of a string
  • replace() - Replaces parts of a string with the a new string  
  • Date() - Return the time and date of today  
  • getDate() - Returns the date of the current month in accordance with the local time  
  • getDay() - Returns the day of the current week in accordance with the local time  
  • getHours() - Returns the hours of the specified day in accordance with the local time  
  • getMilliseconds() - Returns the milli seconds of the specified date in accordance with the local time 
  • getMinutes() - Returns the minutes of the specified date in accordance with the local time 
  • every() - Returns the value to be true if every element present in an array is in accordance with the testing function given
  • filter() - Filter out the elements of an array according to the given condition and creates a new array  
  • forEach() - Calls the function for every element in the array  
  • push() and pop() - To remove and add an element to the index of the array respectively  
  • abs() - Provides the absolute value of a number 
  • acos() - Provides the arc cosine of the number 

Similarly we have functions like cos(), sin(), tan(), acos(), asin(), atan(), log() and many other mathematical functions. 

course logo
Introduction to JavaScript
Number of sections:
Content length:
Delivery formats: