var str = "172.168.1.1";
var res = str.split(".", 2);
gs.log(res);
https://www.w3schools.com/jsref/jsref_split.asp
Showing posts with label javascript. Show all posts
Showing posts with label javascript. Show all posts
Saturday, March 24, 2018
Thursday, March 22, 2018
Get union of 2 arrays removing intersection values (Javascript)
var array1 = ['12','1','10','19','100','test'];
var array2 = ['12','10','19','test1'];
var array3 = array1.filter(function(obj) { return array2.indexOf(obj) == -1; });
var array4 = array2.filter(function(obj) { return array1.indexOf(obj) == -1; });
gs.print('----> array1 Values----->'+ array1);
gs.print('----> array2 Values----->'+ array2);
gs.print('----> array3 Values----->'+ array3);
gs.print('----> Concat Values----->'+ array3.concat(array4));
Reference:
https://stackoverflow.com/questions/1584370/how-to-merge-two-arrays-in-javascript-and-de-duplicate-items
Subscribe to:
Posts (Atom)
Discovery troubleshooting | Error messages
Discovery troubleshooting | Error messages - Support and Troubleshooting (servicenow.com) Description Learn how to resolve common Discover...
-
Steps to Debug Inbound REST API Calls in Service Now: 1. Make sure the property “ glide.rest.debug ” is set to true under sys_prop...
-
Get the instance name from BusinessRule in ServiceNow to avoid Hardcoding. Create a Global variable and assign the instance to it and he...
-
Error : Authentication Failure with the local MID Server Service Credentials. Cause : When Discovery is scheduled for the Wind...

