Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Confirm the EndingPassed--Javascript

function confirmEnding(str, target) {
  // "Never give up and good luck will find you."
  // -- Falcor

  let re = new RegExp(target + "$", "i");

  return re.test(str);
}

console.log(confirmEnding("Bastian", "n"));
Comment

Confirm the EndingPassed--Javascript

function confirmEnding(str, target) {
  return str.slice(-target.length) === target
}

confirmEnding("Bastian", "n");
Comment

PREVIOUS NEXT
Code Example
Javascript :: url-regex-improvement-to-allow-localhost-url 
Javascript :: image uploading payload 
Javascript :: multiple js files vuejs 
Javascript :: Detect backspace pressed eventlistener 
Javascript :: bootstrapMaterialDatePicker min date depends on other field value 
Javascript :: readonly checkbox angular 
Javascript :: how to reload page with router next js 
Javascript :: Rectangle star pattern in JavaScript 
Javascript :: limiting the length of dynamic text inside html element 
Javascript :: stop React Ant Design Upload component from posting files automatically 
Javascript :: flyweight 
Javascript :: tictactoe using Jquery 
Javascript :: mongoose post new document 
Javascript :: Temporarily Edit Text on Any Website 
Javascript :: nodejs process object 
Javascript :: js sol 
Javascript :: fetch image from cloudinary in nodejs 
Javascript :: jquery database add dropdown in datababe grid 
Javascript :: variable local and global 
Javascript :: filewatcher nodejs 
Javascript :: typeof regex 
Javascript :: taylors javascript test 
Javascript :: reload stylesheet with out refresh page 
Javascript :: express static page 
Javascript :: mongoose connecting directly rather than tunnel 
Javascript :: discord.js v12 to v13 
Javascript :: accessing parents DOM 
Javascript :: javascript grow function 
Javascript :: min expression postgresql 
Javascript :: automatically adjust color 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =