Are they close neighbors?

Report a typo

Write a function that takes a string as input and checks if all characters in the string have sequential Unicode values (in decimals). The function should return true if all characters have sequential values and false otherwise. Use the codePointAt() method.

Sample Input 1:

abcd

Sample Output 1:

true
Write a program in JavaScript
const readline = require('readline');

/* Do not change code above */

function sequentialCharTest(str) {
//Write your code here
}

/* Do not change code below */

const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});

rl.on('line', (input) => {
const result = sequentialCharTest(input);
console.log(result);
});
___

Create a free account to access the full topic