VOOZH about

URL: https://www.geeksforgeeks.org/angular-js/angularjs-angular-equals-function/

⇱ AngularJS angular.equals() Function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

AngularJS angular.equals() Function

Last Updated : 1 Aug, 2022

The angular.equals() Function in AngularJS is used to compare two objects or two values whether these are the same or not. If the two values are the same, it returns TRUE else it will return FALSE. The angular.equals() Function supports value types, regular expressions, arrays and objects.

Syntax:

angular.equals(val1, val2);

Parameter value:

  • val1 & val2: It specifies the values or the objects that is to be compared.

Return Value: Returns a boolean value ie either TRUE or FALSE.

Example 1: This example illustrates the implementation of the angular.equals() Function in AngularJS, by comparing the values.

Output:

👁 Image
 

Example 2: This example illustrates the implementation of the angular.equals() Function in AngularJS, by verifying its value type to authenticate the password.

Output:

👁 Image
 
Comment
Article Tags:

Explore