In the new version of open layers 'instanceof' is replaced with getZIndex. How is it serving the same purpose as checking whether the style is a style object or not. From online forum, getZIndex tells us about the rendering order of the object. Please see the example below:
ol.asserts.assert(obj instanceof ol.style.Style,41); is replaced with ol.asserts.assert(typeof(obj).getZIndex === 'function',41);