JS logic v 2.