add arrays verifying in javascript