Profile
Achievement
davidwaterston's Recent Snippets
- All /
« Prev 1 Next »
Javascript which converts a Date object into an ISO 8601 formatted string - 'YYYY-MM-DDTHH:mm:ss.sssZ' - with a fallback for when the function 'toISOString' doesn't exist (e.g. IE 8 or less).
Usage:
var now = new Date;
console.log(now.toISOStrin...
0
1549
posted 11 years ago by davidwaterston
JavaScript
Template for a Javascript function with optional and mandatory arguments passed as an object collection
A simple template for a JavaScript function which allows for an arbitrary number of named arguments to be passed in. This is achieved by passing a single object as an argument with each of the 'real' arguments being a key/value pair. In this way argu...
0
1351
posted 11 years ago by davidwaterston