object, array deep checking imperatively