Skip to content

m7rlin/js-helpers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

js-helpers

Helper functions for javascript/Node.js — helps with strings, objects, arrays... .

String

ucfirst(string)

@return: string

Capitalize first letter of the string.

lcfirst(string)

@return: string

Lowercase first letter of the string.

removeExtraSpaces(string)

@return: string

Removes whitespace from both sides of a string (like trim()).

Transforms all double spaces into one space.

mapValue(value, inMin, inMax, outMin, outMax)

@return: integer

Transforms value between input and output -> min and max values.

Example: We want to have the output value between 1 to 10. But the input can be 1 to 1000. inputValue = 100 outputValue = 10

About

Javascript helper functions to help manipulate strings, objects, arrays. Created for node and modern browsers. Not tested on old browsers.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors