How to use the toBoolean function from underscore.string

Find comprehensive JavaScript underscore.string.toBoolean code examples handpicked from public code repositorys.

5
6
7
8
9
10
11
12
13
14
function isNumber(x) {
  return x.length > 0 && !isNaN(x);
}

function isBoolean(x) {
  return s.toBoolean(x) !== undefined;
}

module.exports.run = function(command, str, args) {
  return R.apply(
fork icon1
star icon2
watch icon2

+ 13 other calls in file

983
984
985
986
987
988
989
990
991
992
993
s.center    = s.lrpad;
s.rjust     = s.lpad;
s.ljust     = s.rpad;
s.contains  = s.include;
s.q         = s.quote;
s.toBool    = s.toBoolean;
s.camelcase = s.camelize;
s.mapChars  = s.map;



fork icon0
star icon6
watch icon0