declarative programming for javascript