Converts the first character of `string` to upper case and the remaining to lower case.
capitalize('FRED')
// => 'Fred'
Name | Type | Attribute | Description |
---|---|---|---|
string | The string to capitalize. |
{ "comment": "/**\r\n * Converts the first character of `string` to upper case and the remaining\r\n * to lower case.\r\n *\r\n * @since 3.0.0\r\n * @category String\r\n * @param {string} [string=''] The string to capitalize.\r\n * @returns {string} Returns the capitalized string.\r\n * @example\r\n *\r\n * capitalize('FRED')\r\n * // => 'Fred'\r\n */", "meta": { "range": [ 361, 436 ], "filename": "capitalize.js", "lineno": 16, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\lodash\\lodash-repo", "code": { "id": "astnode100000361", "name": "capitalize", "type": "FunctionDeclaration", "paramnames": [ "string" ] } }, "description": "Converts the first character of `string` to upper case and the remaining\rto lower case.", "since": "3.0.0", "tags": [ { "originalTitle": "category", "title": "category", "text": "String", "value": "String" } ], "params": [ { "type": { "names": [ "string" ] }, "optional": true, "defaultvalue": "''", "description": "The string to capitalize.", "name": "string" } ], "returns": [ { "type": { "names": [ "string" ] }, "description": "Returns the capitalized string." } ], "examples": [ "capitalize('FRED')\r// => 'Fred'" ], "name": "capitalize", "longname": "capitalize", "kind": "function", "scope": "global", "___id": "T000002R000034", "___s": true, "filepath": "capitalize.js" }