parity_of_two_strings
v1.1.1
Published
A small utility function to check if two strings have the same length parity (both even or both odd).
Readme
parity_of_two_strings
A small utility function to check if two strings have the same length parity (both even or both odd).
Installation
npm install parity_of_two_stringsUsage
const stringParity = require("parity_of_two_strings");
console.log(stringParity("Hello", "There")); // true (both have odd length)
console.log(stringParity("John", "Cynthia")); // false (one is even, one is odd)API
stringParity(stringA, stringB)
- stringA (string) – The first string to compare.
- stringB (string) – The second string to compare.
- Returns:
trueif both strings have the same length parity, otherwisefalse.
Running Tests
npm test