adding functional js examples