repl.it
@anonymous/

BewitchedImpressionableXenotarsosaurus

ES6

No description

fork
loading
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
let res = {
  distance: 2,
  difference: 7,
  key: 'asdasdasd'
}

const word = (() =>  {
  if (res.distance === 0) return 'a';
  if (res.distance === 1 && res.difference > 3) return 'b';
  if (res.distance === 2 && res.difference > 5 && String(res.key).length > 5) return 'c';
  return 'd';
})();

console.log(word)
Babel Compiler v6.4.4 Copyright (c) 2014-2015 Sebastian McKenzie