LoginSignup
0

More than 3 years have passed since last update.

P5.js 日本語リファレンス(clearStorage)

Last updated at Posted at 2020-05-20

このページでは「P5.js 日本語リファレンス」 の clearStorage関数を説明します。

clearStorage()

説明文

storeItem() で保存したすべてのローカルストレージアイテムをクリアします。

構文

clearStorage()

function setup() {
  let myNum = 10;
  let myBool = false;
  storeItem('key1', myNum); // key1 に 10 を保存します  
  storeItem('key2', myBool); // key2 に false を保存します
  print(getItem('key1'));
  print(getItem('key2'));
  clearStorage() ;        // クリアします 
  print(getItem('key1')); // 再度、key1 を取得します -> NULL を表示
  print(getItem('key2')); // 再度、key2 を取得します -> NULL を表示
}

著作権

p5.js was created by Lauren McCarthy and is developed by a community of collaborators, with support from the Processing Foundation and NYU ITP. Identity and graphic design by Jerel Johnson.

ライセンス

Creative Commons(CC BY-NC-SA 4.0) に従います。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0