JSFiddle - React, Tailwind, and code Playground
by evgkch
JavaScript
const callWithoutCrashing = (callback) => {
try {
return callback;
} catch(e) {
console.warn('!!!')
}
}
const getPropFromUserProgram = (userProgram, callback) => {
return callWithoutCrashing(callback(userProgram))
};
const getACBCount = (acbType) => {
return getPropFromUserProgram(
false,
(userProgram) => userProgram.test.a
);
};
console.log(getACBCount())