Chris West's Blog

  • Home
  • Site Search
  • About Me
  •  YourJS
  • Search for:

JavaScript, Math, and much more.

Blog

JavaScript Snippet – Is This In An IFRAME?

Recently I had to determine when my code is running in an iframe. In order to do this many would simply use this code: Unfortunately, if you are writing code that can potentially be added to any page (even those Read more…

By Chris West, 12 years ago March 10, 2014
Blog

JavaScript – Faking Native Functions

The other day I kind of just wanted a reason to write a Gist and embed it on my site using this method. What I came up with was a quick way to make all functions appear to be native: Read more…

By Chris West, 12 years ago February 28, 2014
Blog

EcmaScript 6 – String.prototype.repeat()

One simple function that is on the roster to be released in EcmaScript 6 is String.prototype.repeat. The following can be used to define it in browsers which don’t currently have it defined natively: Here are some examples of using this Read more…

By Chris West, 12 years ago February 27, 2014
Blog

JavaScript – Fraction Part of a Number

One thing that is common knowledge about JavaScript and other languages is that floating point numbers are not always stored the way you think. Also doing math with these numbers is even more iffy. One thing I recently wanted to Read more…

By Chris West, 12 years ago February 26, 2014
Blog

JavaScript – Testing For Negative Zero

One thing that I always took for granted until last week was testing for negative numbers. What I mean is that I had no clue that -0 is actually different from 0. Interestingly enough when using strict equality to test Read more…

By Chris West, 12 years ago February 25, 2014
Blog

EcmaScript 6 – Math.sign()

One function I didn’t think would be doable in most browsers was the Math.sign. My main worry was that on the MDN page it specifies a difference between negative zero and positive zero. After doing some research I found this Read more…

By Chris West, 12 years ago February 24, 2014
Blog

EcmaScript 6 – Array.of()

A function that is proposed to be added to EcmaScript 6 is Array.of(). This function will be used to create an array of the passed parameters. Since this function is available in some browsers but not in all, here is Read more…

By Chris West, 12 years ago February 21, 2014
Blog

EcmaScript 6 – Math.hypot()

Many know that JavaScript features vary from browser to browser. In the case of Firefox, there are many new features that have been proposed in EcmaScript 6. One of them is Math.hypot. This function adds up the squares of each Read more…

By Chris West, 12 years ago February 20, 2014
Blog

JavaScript – String.prototype.toProperCase()

Now Available in YourJS At times you may need to format a string so that it is more appealing. One function that does this is String#toProperCase() because it actually capitalizes the first character of each word. Even though I already Read more…

By Chris West, 12 years ago February 7, 2014
Blog

JavaScript Snippet – String.prototype.count

One string method that I found today in Python is the count function to determine how many times a given substring appears in a string. Below is the equivalent of this function in JavaScript: It is important to note that Read more…

By Chris West, 12 years ago January 7, 2014

Posts navigation

Previous 1 … 12 13 14 … 36 Next
Meta
  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Archives
Categories
Blog (346) CSharp (1) Games (3) HTA (2) Java (5) JavaScript (220) JScript (149) Math (49) Microsoft Office (16) Movie Trailers (2) PHP (13) POW Answer (2) Problem of the Week (31) Python (15) Reporting (1) Salesforce (6) SQL (28) VBA (6) VBScript (8) Videos (10)
Tags
Apache (1) Apex (3) Array (37) Audio (2) Bash (3) Canvas (7) Chrome (3) CSS (12) CSS3 (2) Curry (1) Date (6) EcmaScript 6 (8) Encryption (2) Español (2) Excel (20) Function (136) GitHub (12) Hack (9) HTML (4) HTML5 (2) JasperReport (2) JasperServer (1) jPaq (35) JSON (2) JSONP (2) JW.org (5) Logic Puzzle (2) LWC (2) Mail Merge (1) Math (53) Network (1) OpenKM (2) PostgreSQL (27) Private Data (4) Problem of the Week (31) Prototype (41) Quirk (3) Recursion (10) Regular Expressions (22) String (62) SVN (1) Video (2) Wildcards (3) WScript (2) YourJS (18)
  • About Me
Hestia | Powered by WordPress