up.Params up.Params.prototype.get(name)
Instance method

Returns the first param value with the given name.

Returns undefined if no param value with that name is set.

If the name denotes an array field (e.g. foo[]), all param values with the given name are returned as an array. If no param value with that array name is set, an empty array is returned.

To always return a single value, use up.Params#getFirst() instead. To always return an array of values, use up.Params#getAll() instead.

Example

let params = new up.Params([
  { name: 'foo', value: 'fooValue' },
  { name: 'bar[]', value: 'barValue1' },
  { name: 'bar[]', value: 'barValue2' }
])

let foo = params.get('foo')
// foo is now 'fooValue'

let bar = params.get('bar[]')
// bar is now ['barValue1', 'barValue2']

Parameters

name
required
Type: string