Functional Analysis : JavaScript explanation