xxxxxxxxxx
function greet(name) {
function displayName() {
console.log('Hi' + ' ' + name);
}
// returning a function
return displayName;
}
const g1 = greet('John');
console.log(g1); // returns the function definition
g1(); // calling the function
xxxxxxxxxx
{/* short-circuit evaluation. */}
{chartKey !== 'weather_summary' && (
<ChartWrapper
chartTitle={filteredData[chartKey].chart_title}
chartType={filteredData[chartKey].chart_type}
chartData={filteredData[chartKey].values}
/>
)}