function expect(value) {
return {
toBe: (expectedValue) => {
console.log(`expect ${value} to be ${expectedValue}`, value === expectedValue ? '✅' : '❌')
}
}
}
/**
* 灵雀云前端面试题:实现 isPalindrome 函数
* 判断指定的字符串是否位回文串(正读和反读都一样的字符串)
*/
function isPalindrome(str){
}
// 期望以下测试用例能够通过
expect(isPalindrome('abccba')).toBe(true);
expect(isPalindrome('abcdef')).toBe(false);