Giter Club home page Giter Club logo

util.js's Introduction

**Note:** Not maintained

Util.js

Javascript utility functions that I might need to reuse

---

window.util

  + boolean hasOwn (string key)
      Reference to Object.prototype.hasOwnProperty

  + string toString ()
      Reference to Object.prototype.toString

  + int push (mixed element1, ... mixed elementN)
      Reference to Array.prototype.push

  + int indexOf (mixed searchElement, int fromIndex = null)
      Reference to Array.prototype.indexOf with a fallback for old browsers

  + array filter (function fun, object thisp)
      Reference to Array.prototype.filter with a fallback for old browsers

  + string trim (string str)
      Reference to String.prototype.trim with a fallback for old browsers

  + object getProto (object obj)
      Reference to Object.getPrototypeOf with a fallback for old browsers

  + string ucfirst (string str)
      Upper case first character of string

  + int each (mixed o, function callback, object context = null, mixed data = null, boolean check_all = false)
      Loops over arrays or objects

  + int randomInteger (int min, int max)

  + string escapeHTML (string text)
      Escape any HTML from user input

  + XMLHttpRequest xhr ()
      Cross browser XMLHttpRequest

  + array arrayDiff (array a, array b)

  + mixed shallowClone (mixed o)

  + string appendObjToUrl (string url, object obj)

  + string queryStringFromUrl (string url)

  + string objToQueryString (object obj)

  + object queryStringToObj (string str)

  + boolean isType (mixed o, string type)

  + boolean isArray (mixed o)

  + boolean isFunction (mixed o)

  + boolean isObject (mixed o)

  + boolean isBoolean (mixed o)

  + boolean isUndefined (mixed o)

  + boolean isNull (mixed o)

  + boolean isString (mixed o)

  + boolean isNumber (mixed o)

util.js's People

Contributors

aiham avatar

Stargazers

lztkdr avatar  avatar Mohamed Chorfa avatar

Watchers

 avatar James Cloos avatar lztkdr avatar

Forkers

mchorfa

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.