Tagged Questions
1
vote
1answer
45 views
Pascal's Triangle in Javascript
Here's the problem statement:
Given an integer value, print out Pascal's Triangle to the corresponding depth in row-major format:
Input Sample:
6
Output Sample:
1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 ...
2
votes
0answers
35 views
functional javascript - recursively walking a tree to build up a new one; could this be better factored as a reduce?
/**
* recursively build a nested Backbone.Model or Backbone.Collection
* from a deep JSON structure.
*
* undefined for regex values
*/
exports.modelify = function modelify (data) {
if ...
2
votes
1answer
89 views
Javascript “recursion” via setTimeout
I understand that because of Javascript's single-threaded execution, long loops or recursive calls could make the browser unresponsive while they execute.
I thought about simulating recursion using ...