# Lodash. vs \_. difference

**URL:** <https://community.dreamfactory.com/t/lodash-vs---difference/2599>\
**Category:** Server-Side Scripting\
**Created:** [April 30, 2016, 6:17pm UTC](https://community.dreamfactory.com/t/lodash-vs---difference/2599 "2016-04-30T18:17:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![m\_menon](https://avatars.discourse-cdn.com/v4/letter/m/85f322/32.png) [@m\_menon](https://community.dreamfactory.com/u/m_menon)\
**Post date:** [April 30, 2016, 6:17pm UTC](https://community.dreamfactory.com/t/lodash-vs---difference/2599/1 "2016-04-30T18:17:13Z")

</div>

I am trimming an array this way using lodash

`var data_parts = lodash._.map(strData.split("|"), lodash._.trim);`

but I don’t see the lodash. prefix in most examples that I see on websites. They almost all just use `_.map`

Any clarification why I need to use `lodash._.map` whereas examples on lodash website just uses `_.map`

---

<div class="post-metadata">

**Author:** ![andersonmuller](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@andersonmuller](https://community.dreamfactory.com/u/andersonmuller)\
**Post date:** [May 3, 2016, 1:59am UTC](https://community.dreamfactory.com/t/lodash-vs---difference/2599/2 "2016-05-03T01:59:07Z")

</div>

Hi m\_menon,

I think its because you need to load (using require()) the library.  
DF 1.5 intro service side scripts (and lodash), as you can see [here](https://blog.dreamfactory.com/dreamfactory-introduces-server-side-scripting), at this time, you dont need any prefix.  
But in DF 2.0.3 they remove the loading of lodash by default, as you can see [here](https://wiki.dreamfactory.com/DreamFactory/Release_Notes#Version_2.0.3_.28Released_December_22.2C_2015.29), so, now you need to use require() to load lodash, and require() must to create an object with the evaluated script content… AFAIK. 🙂

Cheers!

---

<div class="post-metadata">

**Author:** ![m\_menon](https://avatars.discourse-cdn.com/v4/letter/m/85f322/32.png) [@m\_menon](https://community.dreamfactory.com/u/m_menon)\
**Post date:** [May 3, 2016, 3:47am UTC](https://community.dreamfactory.com/t/lodash-vs---difference/2599/3 "2016-05-03T03:47:26Z")

</div>

hi Anderson,

Cool thanks a ton for the explanation 😌. I just wanted to make sure that I fully understand the code that I write. Everywhere on the net, the snippets and samples were all `_.method` instead of `lodash._.method` (which I followed), which left me confused.

Cheers,  
M.M
