JAVASCRIPT   36

substr.js

Guest on 12th January 2022 12:11:43 AM

  1. 'use strict';
  2.  
  3. module.exports = function(a, b) {
  4.   a = String(a);
  5.   b = String(b);
  6.   return a.substr(a.length - b.length) === b;
  7. };

Raw Paste


Login or Register to edit or fork this paste. It's free.