Answers for "map with if condition in js"

0

map with if condition in js

row = this.props.cells.map(function(cell, i) {

        if(cell.URL != null && cell.URL.length > 0){
            return <td className={cell.Meta.HTMLClass} key={i}>{cell.Text}</td>;        
        }
        else {
            return <td className={cell.Meta.HTMLClass} key={i}>{cell.Text}</td>;
        }

    }.bind(this));
Posted by: Guest on September-15-2021

Code answers related to "map with if condition in js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language