Trilium Backend API
    Preparing search index...
    • Pass each element in the current matched set through a function, producing a new Cheerio object containing the return values. The function can return an individual data item or an array of data items to be inserted into the resulting set. If an array is returned, the elements inside the array are inserted into the set. If the function returns null or undefined, no element will be inserted.

      Type Parameters

      • T
      • M

      Parameters

      • this: Cheerio<T>
      • fn: (this: T, i: number, el: T) => M | M[]

        Function to execute.

      Returns Cheerio<M>

      The mapped elements, wrapped in a Cheerio collection.

      $('li')
      .map(function (i, el) {
      // this === el
      return $(this).text();
      })
      .toArray()
      .join(' ');
      //=> "apple orange pear"