code: function cast(value, type) {
  	// if type is not specified
  	if (type === undefined) {
  		logger.debug('Type is not specified. Skipping typecast...');
  		return value;
  	}
  
  	// resolving JavaScript type
  	var jsType = nexlExpressionsParser.NEXL_TYPES[type];
  
  	// validating ( should not happen )
  	if (jsType === undefined) {
  		throw util.format('Unknown [%s] type in [%s] expression. Use one of the following types : [%s]', type, this.nexlExpressionMD.str, Object.keys(nexlExpressionsParser.NEXL_TYPES).join(','));
  	}
  
  	var currentType = j79.getType(value);
  
  	// if both types are same, return value as is
  	if (currentType === jsType) {
  		logger.debug('Source and destinations types are same [%s]. Skipping typecast...', jsType);
  		return value;
  	}
  
  	// cast to null
  	if (jsType === nexlExpressionsParser.JS_PRIMITIVE_TYPES.NULL) {
  		logger.debug('Destination type is %s. Converting current value to %s', jsType, jsType);
  		return null;
  	}
  
  	// cast to undefined
  	if (jsType === nexlExpressionsParser.JS_PRIMITIVE_TYPES.UNDEFINED) {
  		logger.debug('Destination type is %s. Converting current value to %s', jsType, jsType);
  		return undefined;
  	}
  
  	return castInner(value, currentType, jsType);
  }
docs: example : value = 101; nexlType = 'bool';