js-draw
Version:
Draw pictures using a pen, touchscreen, or mouse! JS-draw is a drawing library for JavaScript and TypeScript.
15 lines (14 loc) • 428 B
JavaScript
// Returns the description of all given elements, if identical, otherwise,
// returns null.
export default (localizationTable, elems) => {
if (elems.length === 0) {
return null;
}
const description = elems[0].description(localizationTable);
for (const elem of elems) {
if (elem.description(localizationTable) !== description) {
return null;
}
}
return description;
};