JavaScript
Explicit return types

by Benny Neugebauer

function validate(a, b) {
  if(Object.is(a, b)) {
    return;
  } else {
    throw new Error('The two parameters are unequal.');
  }
}

function validate(a, b) {
  if(Object.is(a, b)) {
    return undefined;
  } else {
    throw new Error('The two parameters are unequal.');
  }
}