get(key: string): null | string
Parameter | Type | Description |
key | string | Key. |
Type | Description |
null or string | The first value for the specified key, or null if not found. |
import url from 'pts/url';export default function() {const params = new url.URLSearchParams('key1=value1&key2=value2');const value1 = params.get('key1');console.log(value1); // value1const value3 = params.get('key3');console.log(value3); // null}
Feedback