module.exports = function (defaultNope) {
  return function (val, yep, nope) {
    let result

    if (typeof val === 'object' && val[Symbol.iterator] != null) {
      result = []

      for (let item of val) {
        result.push(typeof yep === 'function' ? yep(item) : yep)
      }

      val = result.length > 0

      yep = result
    }

    result = val ? yep : (nope != null ? nope : defaultNope)

    if (typeof result === 'function') {
      result = result()
    }

    return result
  }
}

@@ -76,24 +76,8 @@
 ) %7B%0A
-    let result%0A%0A
     
@@ -137,32 +137,36 @@
 = null) %7B%0A      
+let 
 result = %5B%5D%0A%0A   
@@ -323,24 +323,28 @@
 %0A    %7D%0A%0A    
+let 
 result = val

Use let