This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
var getCatalog = new GlideRecord("sc_cat_item"); | |
getCatalog.addEncodedQuery("active=true^hide_sp=false^sys_class_name=sc_cat_item"); //Update this | |
getCatalog.query(); | |
while (getCatalog.next()) { | |
var addVariableSet = new GlideRecord("io_set_item"); | |
addVariableSet.initialize(); | |
addVariableSet.sc_cat_item = getCatalog.getValue("sys_id"); | |
addVariableSet.variable_set = "86f3c8b51b0d9c508ed631d7dc4bcbcd"; //variable set sys_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var numberAdded = 0; | |
var numberSubtracted = 0; | |
var subtractedNumberAdded = 0; | |
for (var number = 10; number < 10000000; number++) { | |
numberAdded = number.toString().split('').map(Number).reduce(function (a, b) { | |
return a + b; | |
}); | |
numberSubtracted = number - numberAdded; | |
subtractedNumberAdded = numberSubtracted.toString().split('').map(Number).reduce(function (a, b) { | |
return a + b; |