JSFiddle - React, Tailwind, and code Playground

by Mottie

HTML

<div class="test">div1</div>
<div class="test">div2</div>

JavaScript

var $test = $('.test');


// expect: true true null
console.log( 
    $test.filter(':eq(0)').length === 1,   
    $test.filter(':eq(-1)').length === 0,
    $test.filter(':eq(-1)').html() // returns "div1" in IE8 and older
);