/lang

Provide basics methods for Array, Function, Number, Object and String

Primary LanguageJavaScriptMIT LicenseMIT

kaoscript License NPM Version Dependency Status Build Status CircleCI Coverage Status

Provide basics methods for Array, Function, Number, Object and String

Compatibility

Chrome Edge Firefox IE Safari Android iOS Node.js
✔️ 72 ✔️ 16 ✔️ 65 ✔️ 11 ✔️ 12 ✔️ 8.0 ✔️ 12 ✔️ 11
✔️ 40 ✔️ 13 ✔️ 47 ✔️ 9* ✔️ 8 ✔️ 4.4 ✔️ 9 ✔️ 4.5*

* tested manually due to limitation of automated testing tools

Polyfill

Here an example how a polyfill is defined:

#[if(any(lt(chakra-v1.3), lt(ecma-v8), lt(jsc-v10), lt(monkey-v48), trident, lt(v8-v5.7)))]
impl String {
	padStart(targetLength: Number, pad: String = ' '): String => pad.repeat(targetLength - this.length) + this
}

#[else]
disclose String {
	padStart(targetLength: Number, pad: String = ' '): String
}

License

Copyright © 2016 Baptiste Augrain

Licensed under the MIT license.