Underscore.js _.pairs() Function

The _.pairs() function is used to convert an object into [key, value] pairs.
Syntax:
_.pairs( object )
Parameters: This function accepts one parameter as mentioned above and described below:
- object: It contains the object element that holds the elements of key and value pair.
Return Value: It returns the list of [key, value] pair.
Example 1:
| <!DOCTYPE html> <html>  Â<head>     <scripttype="text/javascript"            src=     </script> </head>  Â<body>     <scripttype="text/javascript">  Â        var obj = {             Company: "zambiatek",             Address: "Noida",             Contact: "+91 9876543210",             Email: "abc@gfg.com"         }         console.log(_.pairs(obj));     </script> </body>  Â</html>  | 
Output:
Example 2:
| <!DOCTYPE html> <html>  Â<head>     <scripttype="text/javascript"            src=     </script> </head>  Â<body>     <scripttype="text/javascript">  Â        var objectPair = _.pairs({ num1: 10, num2: 15, num3: 20, num4: 25, num5: 30 });  Â        console.log(objectPair);     </script> </body>  Â</html>  | 
Output:
 
				 
					



