Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function nounReplace(x, y){
- if(y === "{noun}"){
- return "{noun}"; //Return a random singular noun instead
- }else{
- return "{nouns}"; //Return a random plural noun instead
- }
- }
- message.replace(/(\{nouns?\})/gi, nounReplace);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement