TypeScript
Functional programming for if-statements

by Benny Neugebauer

const no = (value: string) => value.length === 0;

if (no(config.lastBuy)) {
  logger.log('No last buy setup.');
}

if (no(config.quantity)) {
  logger.log('No quantity supplied.');
}

if (config.lastBuy.length === 0) {
  logger.log('No last buy setup.');
}

if (config.quantity.length === 0) {
  logger.log('No quantity supplied.');
}