Skip to content

Instantly share code, notes, and snippets.

@OliverJAsh
Created May 5, 2020 13:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OliverJAsh/0b237fcbc03254828669088bc3113735 to your computer and use it in GitHub Desktop.
Save OliverJAsh/0b237fcbc03254828669088bc3113735 to your computer and use it in GitHub Desktop.
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