Functional graph computation for javascript