code: function takeWhile(f, xs) {
      const ys = [];
      for (const x of xs) {
          if (f(x)) {
              ys.push(x);
          }
          else {
              break;
          }
      }
      return ys;
  }
docs: Returns the longest prefix of elements that satisfy the predicate