JSFiddle - React, Tailwind, and code Playground

by tara5

JavaScript

var bar = {
    doSomething: function(){},
    doSometingElse: function(){}
}

var foo = {};

// 1: how could you rewrite the following to make it shorter?
if (foo) {
  bar.doSomething();
} else {
  bar.doSomethingElse();
}