Pascal's triangle JS formatting
Multi-digit number is what is throwing it off. I typically fix this by opting to find the highest number and then offset the rest of them appropriately.  I did this back when I was messing around with polynomial triangles.

Fixing the spacing issue

I started by getting the longest possible number and then prepending the space before it to make it line up properly.

Nextly, you have to fix the preappend so it looks better over size 2.  This is accomplished over a fairly odd algorithm.

As for the rest of the code, I did not have time to look at it, but will in a bit.

Fixing structure

Overall, your code looked pretty good.  Here are just some suggestions.

I went ahead and moved the pascal array generation to another function.  The idea of a function is that it performs a task.  Logically breaking up these tasks into multiple functions limits the size of each function and increases readability.  From there, we can assign it to a variable inside the pascal function.  I used the intuitive name generatePascalArrays, so you can get the gist of what the function does from the variable assignment.

Secondly, I noticed you split the 1 and 0 exception cases, I combined that into one if and console.log(num).

Additionally, I did use some arrow functions.  In other languages, you may have heard of them as lambda functions.  If you are not familiar with them, here is a link.



function generatePascalArrays(num) {
  var result = [[1],[1,1]];
  for (var i = 2; i &lt; num; i++) {
    result[i] = [];
    result[i][0] = 1;
    for (var j = 1; j &lt; i; j++) {
      result[i][j] = result[i - 1][j - 1] + result[i - 1][j];
    }
    result[i][j] = 1;
  }
  return result;
}

function pascals(num) {  
  if (num &lt;= 1) {
    console.log(num);
  }
  var result = generatePascalArrays(num),  
      width = Math.max(...result[result.length-1]).toString().length;  
  for (var i = 0; i &lt; result.length; i++) {
 let preOffsetter = result[result.length-i-1].length * Math.floor(width/3) + result.length - i
 console.log(' '.repeat(preOffsetter) + result[i].map((x) =&gt; ' '.repeat(width - x.toString().length) + x));
  }
}

pascals(5)
pascals(6)
pascals(10)