Created
May 5, 2020 13:54
-
-
Save OliverJAsh/0b237fcbc03254828669088bc3113735 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { from } from 'ix/iterable'; | |
import { map } from 'ix/iterable/operators'; | |
const compare = (a: string, b: string) => | |
from(a).pipe(map((value, index) => value === b[index])); | |
for (const v of compare('yes', 'yas')) { | |
console.log(v); | |
} | |
// true | |
// false | |
// true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment