full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/average.js#L13
Returns
Number
No options available.
[1, 2, 3].average() // 6
{a: 1, b: 2, c: 3}.average() // 6
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/ellipsis.js#L17
Returns
String
Type | Name | Default | Description |
---|---|---|---|
Integer | options.max | 0 | maximum of character until it should append an ellipsis |
String | otpions.end | "..." | ellipsis character to display if the max character is reached |
"hello world".ellipsis({ max: 5 }) // "hello.."
"hello universe".ellipsis({ max: 5, end: '!' }) // "hello!"
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/empty.js#L17
Returns
Boolean
No options available.
{}.empty() // true
[].empty() // true
''.empty() // true
(0).empty() // true
new Regexp('').empty() // true
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/flatten.js#L14
Returns
Array
No options available.
{a: 1, b: 2, c: 3}.flatten() // [1, 2, 3]
[1, {a: 2, b: 3}].flatten() // [1, 2, 3]
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/format.js#L13
Returns
String
No options available.
"Hi {name}".format({ name: "John" }) // "Hi John"
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/has-letter.js#L14
Returns
Boolean
No options available.
'hello world'.hasLetters() // true
'42 - 7 = ??'.hasLetter() // false
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/has-lowercase.js#L14
Returns
Boolean
No options available.
'Hello'.hasLowercase() // true
'HELLO'.hasLowercase() // false
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/has-math-sign.js#L14
Returns
Boolean
No options available.
'42 + 7'.hasMathSign() // true
'hello world'.hasMathSign() // false
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/has-number.js#L14
Returns
Boolean
No options available.
'42'.hasNumber() // true
'hello world'.hasNumber() // false
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/has-uppercase.js#L14
Returns
Boolean
No options available.
'Hello'.hasUppercase() // true
'hello'.hasUppercase() // false
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/is-array.js#L14
Returns
Boolean
No options available.
new Date().isArray() // false
[].isArray() // true
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/is-boolean.js#L14
Returns
Boolean
No options available.
(true).isBoolean() // true
(1).isBoolean() // false
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/is-date.js#L14
Returns
Boolean
No options available.
new Date('2018-01-01').isDate() // true
'2018-01-01'.isDate() // false
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/is-lowercase.js#L14
Returns
Boolean
No options available.
'hello'.isLowercase() // true
'HELLO'.isLowercase() // false
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/is-number.js#L14
Returns
Boolean
No options available.
Number(42).isNumber() // true
[42].isNumber() // false
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/is-object.js#L14
Returns
Boolean
No options available.
{}.isObject() // true
[].isObject() // false
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/is-regexp.js#L14
Returns
Boolean
No options available.
/[a-z]/.isRegexp() // true
'/[a-z]/'.isRegexp() // false
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/is-string.js#L14
Returns
Boolean
No options available.
"hello".isString() // true
["hello"].isString() // false
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/is-uppercase.js#L14
Returns
Boolean
No options available.
"HELLO".isUppercase() // true
"Hello".isUppercase() // false
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/is-valid-date.js#L16
Returns
Boolean
No options available.
'2018-01-01'.isValidDate() // true
new Date('2018-01-01').isValidDate() // true
'test'.isValidDate() // false
new Date('test').isValidDate() // false
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/is-valid-number.js#L15
Returns
Boolean
No options available.
(42).isValidNumber() // true
Number('test').isValidNumber() // false
"test".isValidNumber() // false
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/is.js#L15
Returns
Boolean
Type | Name | Default | Description |
---|---|---|---|
* | options.type | type to check the element on |
([1, 2]).is({ type: Array }) // true
([1, 2]).is({ type: Boolean }) // false
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/json.js#L13
Returns
String
No options available.
{name: "John"}.json() // {"name": "John"}
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/keys.js#L14
Returns
Array
No options available.
({a: 1, b: 2}).keys() // ['a', 'b']
({}).keys() // []
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/last.js#L15
Returns
*
No options available.
[1, 2, 3].last() // 3
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/log.js#L15
Returns
*
No options available.
"hello".log()
[1, 2].log()
[1, 2].log().average() // chainable
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/map.js#L14
Returns
undefined
Type | Name | Default | Description |
---|---|---|---|
requestCallback | callback | function to apply for each key-pairs |
{a: 1, b: 2, c: 3}.map(myFunction())
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/nl2br.js#L14
Returns
*
Type | Name | Default | Description |
---|---|---|---|
Boolean | options.strict | false | when set to true, it will output strict HTML tag |
"hello\r\nworld".nl2br() // "hello
world"
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/only.js#L18
Returns
*
Type | Name | Default | Description |
---|---|---|---|
Array | search | array of keys (or values for an array) to filter with |
['js', 'php', 'node'].only(['js', 'node']) // ['js', 'node']
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/parse-csv.js#L15
Returns
Array
Type | Name | Default | Description |
---|---|---|---|
String | options.delimitedBy | ',' | character separating the cells |
String | options.quotedBy | '"' | quote character in case a cell contains any delimitedBy character |
"Name,Age\nJohn,25".parseCsv() // [['Name', 'Age'],['John', '25]]
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/parse-date.js#L13
Returns
Date
No options available.
'2018-01-01'.parseDate() // new Date('2018-01-01)
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/parse-int.js#L13
Returns
Integer
No options available.
"42".parseInt() // 42
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/pass.js#L15
Returns
Boolean
Type | Name | Default | Description |
---|---|---|---|
RegExp | options.regexp | /(?:)/ | regular expression to test |
"hello".pass(/[a-z]/g) // true
Number(34).pass(/^[3]/) // true
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/query-strings.js#L13
Returns
Object
No options available.
'http://example.com/path/to/page?name=ferret&color=purple'.queryStrings() // { name: 'ferret', color: 'purple' }
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/shuffle.js#L14
Returns
*
No options available.
[1, 2, 3].shuffle() // [3, 1, 2]
"hello world".shuffle() // "lohel"
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/sum.js#L13
Returns
Number
No options available.
[1, 2, 3].sum() // 6
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/to-camel-case.js#L13
Returns
String
No options available.
'hello world'.toCamelCase() // "helloWorld"
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/to-csv.js#L15
Returns
String
Type | Name | Default | Description |
---|---|---|---|
String | options.delimitedBy | ',' | string delimiter between cells |
String | options.quotedBy | '"' | character to add in case the delimitedBy is present in the cell |
[['John', '25']].toCsv() // "John,25"
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/to-kebab-case.js#L13
Returns
String
No options available.
'hello world'.toKebabCase() // 'hello-world'
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/to-query-strings.js#L13
Returns
String
No options available.
({name: 'John', age: 21}).toQueryStrings() // name=John&age=21
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/to-separated.js#L15
Returns
String
No options available.
['php', 'js', 'mysql'].toSeparated() // "php,js,mysql"
['php', 'js', 'mysql'].toSeparated({ separator: ', ' }) // "php, js, mysql"
['php', 'js', 'mysql'].toSeparated({ separator: ', ', finisher: ' and ' }) // "php, js and mysql"
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/to-snake-case.js#L13
Returns
String
No options available.
'hello world'.toSnakeCase() // "hello_world"
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/to-timestamp.js#L13
Returns
Integer
No options available.
new Date('2018-01-01T00:00:00+00:00').toTimestamp() // 1514764800
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/type.js#L14
Returns
*
No options available.
[1, 2].type() // Array
[1, 2].type({ toString: true }) // "array"
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/update.js#L15
Returns
*
No options available.
({a: 1, b: 2}).update({ a: 3 }) // {a: 3, b: 2}
[1, 2, 3].update({ 0: 4 }) // [4, 2, 3]
"hello".update({ 0: 'y' }) // "yello"
full solution
javascript
web
https://github.com/stellar-labs/prototype-storm/blob/master/src/js/values.js#L14
Returns
Array
No options available.
({a: 1, b: 2}).values() // [1, 2]
({}).values() // []