function calc(str, varsArr) {
  let realValue = get(str, varsArr);
  if (realValue === undefined) {
    throw new Error(`Unresolved variable: ${str}`);
  }
  return realValue;
}
Replace var with value from vars arr.
@param {String} str variable name with $, e.g. '$color'
@param {Array<Object>} varsArr array of variable sets to search into.