JSFiddle - React, Tailwind, and code Playground

code smell test

by Csaba Hellinger

HTML

<div class="alert-area a">
    A
</div>
<div class="alert-area b">
    B <br/> B
</div>

CSS

.a {
    height: 40px;
}

.b {
    height: 60px;
}

JavaScript

//$(function() {


    var fixedTopOffset = 0;

    $('.alert-area').each(function() {
        fixedTopOffset += $(this).height();
    });

    console.log(fixedTopOffset);

//    var test = $('.alert-area').get()
//    console.log('TEST', test);

    fixedTopOffset = $('.alert-area').map(function(index, $item) { 
    	console.log('item', $item);
        return $item.height(); 
    }).sum();

    console.log(fixedTopOffset);

//});