Here you can find the source of spacify()
String.prototype.spacify = function () { return this.split('') .filter(e => e !== ' ') .join(' ');//from w ww . j a va 2 s . c o m };
String.prototype.spacify = function () { return this.split('').join(' '); };
function spacify(str) { return str.split('').join(' '); String.prototype.spacify = function(){ return this.split('').join(' '); console.log(spacify('hello world')); console.log('hello world'.spacify());
String.prototype.spacify = function () { return this.split('').join(" "); };
var spacifyForLoop = function(input) { var word2 = ''; for (var i = 0, max = input.length; i < max; i++) { word2 += input[i] + ' '; return word2; var spacifyNative = function(input) { return input.split('').join(' '); ...
String.prototype.spacify = function() { var sentence = this.replace(/__/g, '-').replace(/_/g, ' '); if (sentence.match(/\s/) && !sentence.match(/\-/)) { var words = sentence.split(' '); for (i in words) { words[i] = words[i][0].toUpperCase() + words[i].substr(1); sentence = words.join(' '); return sentence.replace(/\-/g, '_');
String.prototype.spacify = function() { return this.replace(/([0-9])([a-z])/, '$1 $2'); };
function spacify(str) { return str.split('').join(' ');