Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

259
Vistas
How to use pipe from lodash/fp in HTML?

enter image description hereI downloaded lodash.js from lodash official documentation but _.pipe() is throwing an error in my console.How to resolve this issue

let input = "    JavaScript     ";

const trim = (str) => str.trim();
const toLowerCase = (str) => str.toLowerCase();
const wrapInDiv = (str) => `<div>${str}</div>`;

const transform = _.pipe(trim, toLowerCase, wrapInDiv);

console.log(transform(input));
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.21/lodash.min.js"></script>

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Use the CDN

I can't see /fp directory when I included lodash.js in HTML.

But adding CDN solved the issue.

You have two options to do this.

1.Follow the official documentation in which you need to select the functions that you need (in this case pipe) and lodash.min.js and add this script tag above the existing script tag.

<script src="https://cdn.jsdelivr.net/combine/npm/lodash@4/fp/pipe.min.js,npm/lodash@4"></script>

2.Else Add the complete lodash/fp module and lodash

<script     
src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min.js"
      integrity="sha512-WFN04846sdKMIP5LKNphMaWzU7YpMyCU245etK3g/2ARYbPK9Ub18eG+ljU96qKRCWh+quCY7yefSmlkQw1ANQ=="
      crossorigin="anonymous"
      referrerpolicy="no-referrer"></script>
 <script
      src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.fp.min.js"
      integrity="sha512-PQPary7Ah0W8wFgizjGNg0jWpVUKLAxUCvdTNS4lpQFUtoeg5cmSaI8cJK3zh5TDgHDMMHo3tG3ZcLideDlRuQ=="
      crossorigin="anonymous"
      referrerpolicy="no-referrer"
    ></script>

Lodash CDN Reference

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda