apache_conf 确认结束

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了apache_conf 确认结束相关的知识,希望对你有一定的参考价值。

// My solution - too much thinking leads to complexity

function confirmEnding(str, target) {
  str = str.split(' ').reduce((acc,val)=>val).substr(-target.length);
  return str===target;
}


var res = confirmEnding("Bastian is cool", "ol");
console.log(res);



// a simpler and obvious solution - 

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


// a more direct answer = 
function confirmEnding(string, target) {

  return string.endsWith(target); // added in ECMAScript 6 
}
confirmEnding('Bastian', 'n');

以上是关于apache_conf 确认结束的主要内容,如果未能解决你的问题,请参考以下文章

apache_conf Capistrano部署确认

apache_conf 确认对话框

apache_conf 确认框

apache_conf 提交表格确认

apache_conf 点击确认(jquery)

apache_conf 随机确认码生成器