Skip to content

Instantly share code, notes, and snippets.

View FermiDirak's full-sized avatar
🚴
gone cycling

Bryan Manuele FermiDirak

🚴
gone cycling
View GitHub Profile
@FermiDirak
FermiDirak / PascalsTriangle.js
Last active January 25, 2018 17:26
Pascal's Triangle in JS
/**
* Generates Pascal's triangle
* @param {number} numRows
* @return {number[][]} Pascal's Priangle
*/
var generate = function(numRows) {
var pascalsTriangle = [];
//initial value at top of triangle
if (numRows >= 1) {