Skip to content

Function: setItem()

ts
function setItem(key: string, val: string): boolean

设置cookie的键值对

Example

ts
setItem('test', '你好, 世界!');

Parameters

ParameterTypeDescription

key

string

val

string

Returns

boolean