{"library":"lodash.first","title":"lodash.first","description":"The lodash.first package provides the modern build of lodash's `_.first` function as a standalone npm module, version 3.0.0. This package is part of lodash's modularized approach, allowing developers to import only the specific utility they need, reducing bundle size compared to using the full lodash library. Note that since lodash v4, `_.first` has been deprecated in favor of `_.head`, which offers identical functionality. The modularized packages like lodash.first are frozen at lodash v3.0.0 and are not updated with new releases; they remain in maintenance mode.","language":"javascript","status":"maintenance","last_verified":"Sat Apr 25","install":{"commands":["npm install lodash.first"],"cli":null},"imports":["var first = require('lodash.first')","var _ = require('lodash'); var first = _.first","var head = require('lodash.head')"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"var first = require('lodash.first');\n\n// Get first element of an array\nconsole.log(first([1, 2, 3])); // 1\nconsole.log(first([])); // undefined\n\n// Works with strings too\nconsole.log(first('hello')); // 'h'\n\n// Works on array-like objects\nvar args = function() { return arguments; };\nconsole.log(first(args('a', 'b'))); // 'a'","lang":"javascript","description":"Demonstrates basic usage of lodash.first to get the first element of arrays, strings, and array-like objects.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}