Code Monkey home page Code Monkey logo

jhutils.js's Introduction

JHUtils.js

This is a more updated version of my jsLibrary repo, but without all the jQuery nonsense and some added methods/functionality.

Files

JHUtils.js - Unminified version. JHUtils.min.js - Minified version JHUtils.underscore.js - Unminified Version (requires underscorejs to be available) JHUtils.underscore.min.js - Minified Version (requires underscorejs to be available)

Documentation

JHUtils.ascSort(targetArr)

Sorts the received array's values in ASC order and returns a new array for it. Note: This method only works for a 2-d array such as var myArray = [1,2,3,4,5..];

Example

var originalArr = ['z','b','a']; var sortedArr = JHUtils.ascSort(originalArr); // sortedArr == ['a','b','z'];

JHUtils.dataStore(itemValue)

This is basically a primative version of underscorejs' memoize(). See their documentation for more information.

JHUtils.arrayWithDistinctValuesFromArray(arr)

Returns an array composed of all unique values from the received array. Note: This method only works for a 2-d array such as var myArray = [1,2,3,4,5..];

JHUtils.isInteger(value)

Just a quick helper method to test for a valid integer. There may obviously be better, more effecient ways of doing this sort of thing - but such things are a bit more overkill for my tastes. In the real world (for me at least) - this does the job just fine.

JHUtils.urlToArray(urlString)

Check the documentation at coderholic for usage and original source

JHUtils.log(msg, obj)

Just a helper method to log to console. obj is an optional value that, if supplied, will have its raw value printed immediately after the message.

Example

JHUtils.log("Hello World"); JHUtils.log("All Your Base ", { are: "belong", to: "us" });

jhutils.js's People

Contributors

infolock avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.