Usage
import { Lonely /* function */, resolve /* symbol */ } from 'lonely-operation';
const obj = {
a: {
b: {
c: {
d: 1234
}
}
}
};
alert(Lonely(obj).a.b.c.d[resolve]); // -> 1234
const array = [
[1, 2, 3, 4],
[5, 6, 7],
[8, 9],
];
alert(Lonely(array).filter(a=>a.length > 3)[0].find(n=>n==3)[resolve]); // -> 3
alert(Lonely(array)[10].find(n=>n==2).toString()[resolve]); // -> undefined
const array = [
'aaa',
'bbb'
];
alert(Lonely(array)[0].substr(1)[resolve]); // -> 'aa'
alert(Lonely(Array.prototype).pop.apply(array)[resolve]); // -> 'bbb'