Skip to content
Browse files

Add filledArray.

  • Loading branch information...
1 parent f60fdda commit bbbd70faf1b10bbf71804bac3bf406e8ecdfed27 @jverkoey committed Feb 28, 2010
Showing with 20 additions and 4 deletions.
  1. +20 −4 dev/core/namespace.breeze.js
View
24 dev/core/namespace.breeze.js
@@ -22,16 +22,14 @@ goog.require('goog.math.Matrix');
* Welcome to Breeze.
*
* This library was built with the following dependencies:
- * - jQuery 1.4.2.
* - modernizr 1.1
- * - jPlayer 1.0.0
*
* Created by: Jeff Verkoeyen (jverkoey@gmail.com || @featherless)
* February 20, 2010
*
- * Last time this library was dabbled with: February 22, 2010
+ * Last time this library was dabbled with: February 28, 2010
*
- * This is the root file required to get working with Breeze.
+ * This is the root file required to create the Breeze namespace.
*/
var Breeze = {
arrg : function (iterable) {
@@ -43,6 +41,24 @@ var Breeze = {
}
};
+Breeze.Util = {};
+
+/**
+ * Create an array filled with the given object.
+ *
+ * @param {number} numberOfItems
+ * @param {Object=} opt_value Default: 0
+ * @return {Array.<Object>}
+ */
+Breeze.Util.filledArray = function(numberOfItems, opt_value) {
+ opt_value = opt_value || 0;
+ var array = [];
+ for (var ix = 0; ix < numberOfItems; ++ix) {
+ array.push(opt_value);
+ }
+ return array;
+};
+
/**
* Prototype-based Object extensions.
*/

0 comments on commit bbbd70f

Please sign in to comment.
Something went wrong with that request. Please try again.