Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Disemvowel Trolls

// Trolls are attacking your comment section!
// A common way to deal with this situation is to remove all of the vowels from the trolls' comments, neutralizing the threat.
// Your task is to write a function that takes a string and return a new string with all vowels removed.
// For example, the string "This website is for losers LOL!" would become "Ths wbst s fr lsrs LL!".

function disemvowel(str) {
  let regExp = /[^aeiou]/gi
  let troll = str.match(regExp)
  return troll.join('');
}
console.log(disemvowel("This website is for losers LOL!"))

// With love @kouqhar
Comment

Disemvowel Trolls

function disemvowel(str) {
  
  
   var vowels = ['a','e','i','o','u']
    let newStr = str.split('')
    .filter(el=>vowels.indexOf(el.toLowerCase()) ==-1)
    .join('')
     
     
     
     return newStr;
   }
Comment

PREVIOUS NEXT
Code Example
Javascript :: connect phantom wallet react typescript 
Javascript :: phaser grid align 
Javascript :: phaser place on part of circle 
Javascript :: phaser rotate around distance 
Javascript :: phaser add animation event 
Javascript :: phaser export animation to json 
Javascript :: phaser play animation after repeat 
Javascript :: How to call the API when the search value changes 
Javascript :: NodeJS/express : Cached and 304 status code on chrome 
Javascript :: Clean way to remove text and keep div inside a div jquery 
Javascript :: white when respons show code 
Javascript :: react native bootsplash generate splash 
Javascript :: efectos javascript 
Javascript :: HDEL in redis 
Javascript :: js if animation infinity end 
Javascript :: DataTables warning: table id=datatable - Ajax error 
Javascript :: delete parent js 
Javascript :: javascript brightness filter 
Javascript :: javascript interview questions 
Javascript :: push pop in javascript 
Javascript :: clear cache javascript 
Javascript :: convert a string to array 
Javascript :: export default class react 
Javascript :: download canvas to png 
Javascript :: javascript how to select a array 
Javascript :: how to include bootstrap in react 
Javascript :: how to reload webview in react native 
Javascript :: js get smallest value of array 
Javascript :: date range picker in angular 8 
Javascript :: javascript casting objects 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =