how to get two different random numbers that are different from each other at the same frame in unity code example

Example 1: get all the child of the same class javascript

var doc = document.getElementById("test");
var notes = null;
for (var i = 0; i < doc.childNodes.length; i++) {
    if (doc.childNodes[i].className == "4") {
      notes = doc.childNodes[i];
      break;
    }        
}

Example 2: how to add up all the numbers in between 0 and that number

function addUp(num) {
  if (num === 1) return 1;
  return num + addUp(num - 1);
}