todo review js code