function get(obj, key, val = undefined) {
  if (obj !== null && key in obj) {
    return obj[key];
  }
  return val;
}
Returns the value for the given key.
@param {?Object<K,V>} obj The object from which to get the value.
@param {string} key The key for which to get the value.
@param {R=} val The value to return if no item is found for the given key
    (default is undefined).
@return {V|R|undefined} The value for the given key.
@template K,V,R