diff --git a/korbit-tutorial-6cf36bdf9c6784f2/doWork.ts b/korbit-tutorial-6cf36bdf9c6784f2/doWork.ts new file mode 100644 index 0000000..3910aad --- /dev/null +++ b/korbit-tutorial-6cf36bdf9c6784f2/doWork.ts @@ -0,0 +1,10 @@ +import { processWork } from 'korbit-tutorial-6cf36bdf9c6784f2/util.js'; + +function doSomeWork(workToBeDone: Array) { + let finishedWork = [] + workToBeDone.forEach((workItem) => finishedWork.push(processWork(workItem))) + return finishedWork +} + +let workToBeDone: Array = ["these", "are", "some", "words", null] +console.log(doSomeWork(workToBeDone)) \ No newline at end of file diff --git a/korbit-tutorial-6cf36bdf9c6784f2/util.ts b/korbit-tutorial-6cf36bdf9c6784f2/util.ts new file mode 100644 index 0000000..205310c --- /dev/null +++ b/korbit-tutorial-6cf36bdf9c6784f2/util.ts @@ -0,0 +1,3 @@ +export function processWork(workItem: string) { + return workItem.split("").reverse().join(""); +} \ No newline at end of file