CSS last-child 选择器 ... 父项的最后一个 - 不是最后一个的最后一个

CSS last-child selector ... the last of the parent - not the last of the last

嘿,我快要疯了,只是找不到解决方案

<div class="example">
    <div>
        <div></div>
    </div>
    <div>
        <div></div>
    </div>
    <div> <-- Want to select this
        <div></div> <-- but it always selects this
    </div>
</div>

我想 select .example 的最后一个 div 但它总是 select 是 .example 的最后一个 div 中的最后一个 div如果我做.example:last-child ......如何做对?

尝试 'div.example>div:last-child':

alert(document.getElementById('forCompare') === document.querySelector('div.example>div:last-child'));
<div class="example">
    <div>
        <div></div>
    </div>
    <div>
        <div></div>
    </div>
    <div id="forCompare">
        <div></div>
    </div>
</div>