Emperor01 / JSlearn

all my practical trainings
0 stars 0 forks source link

I've done it) #13

Open Emperor01 opened 6 years ago

Emperor01 commented 6 years ago

'use strict';

function removeClass(obj, className) {

return obj.split(' ').filter( function (item) {return item !== className}).join(' '); }

var obj = { text: 'open menu open open menu' };

obj.text = removeClass(obj.text, 'menu');

alert(obj.text);