tunnckoCore/starts-with

View on GitHub
benchmark/code/re-test.js

Summary

Maintainability
A
1 hr
Test Coverage
/* jshint asi:true */

'use strict'

module.exports = function startsWithReTest (a, b) {
  a = String(a)
  b = String(b)
  var re = new RegExp('^' + b)
  return !!re.test(a)
}