WeakSet delete() 方法
delete方法可以移除WeakSet指定元素。
如果刪除成功返回true,否則返回false。
更多關於WeakSet內容參閱Set和WeakSet 資料結構一章節。
語法結構:
[JavaScript] 純文字檢視 複製程式碼weaksetObj.delete(obj)
引數解析:
(1).obj:必需,要移除的元素。
程式碼例項:
[JavaScript] 純文字檢視 複製程式碼執行程式碼let ws = new WeakSet(); let webName = new String("螞蟻部落"); let age = new Number(4); ws.add(webName); ws.add(age); console.log(ws.delete(age)); console.log(ws.has(age));
程式碼執行效果截圖如下:
相關文章
- Map delete() 方法delete
- WeakMap delete() 方法delete
- Set delete() 方法delete
- URLSearchParams delete() 方法delete
- Sanic delete()方法/函式delete函式
- JavaScript Set與WeakSetJavaScript
- laravel中delete()方法和destroy()方法的區別Laraveldelete
- StringBuffer類的delete()方法和deleteCharAt()方法的區別delete
- ES6【Set 、 WeakSet 、Map、WeakMap 】
- ES6 Set,WeakSet,Map,WeakMap
- 【ES6基礎】Set 與 WeakSet
- 深入理解JavaScript中的WeakMap和WeakSetJavaScript
- python 使用 delete 方法時報錯,可以正常刪除Pythondelete
- JavaScript deleteJavaScriptdelete
- URLSearchParams delete()delete
- FormData delete()ORMdelete
- MySQL防止delete命令刪除資料的兩種方法MySqldelete
- 引用、淺拷貝及深拷貝 到 Map、Set(含物件assign、freeze方法、WeakMap、WeakSet及陣列map、reduce等等方法)物件陣列
- SQL__DELETESQLdelete
- JavaScript delete用法JavaScriptdelete
- git delete and revertGitdelete
- MySQL Delete PHPMySqldeletePHP
- 精講響應式WebClient第3篇-POST、DELETE、PUT方法使用Webclientdelete
- OUTLOOK - Unable to Delete Meetingsdelete
- 740. Delete and Earndelete
- 精講RestTemplate第5篇-DELETE、PUT等請求方法使用詳解RESTdelete
- 簡述六種請求方法,get、head、put、delete、post、options區別delete
- CodeIgniter3 獲取GET/POST/PUT/DELETE方法多種方式傳參delete
- 450-Delete Node in a BSTdelete
- 記憶體(new delete )記憶體delete
- 如何提高MySQL DELETE 速度MySqldelete
- jemalloc delete 出現 segmentfaultdelete
- 簡單幾步教你win10按delete鍵刪除不提示的方法Win10delete
- python--之np.deletePythondelete
- 【SQL】11 SQL DELETE 語句SQLdelete
- [20190825]Join View and delete.txtViewdelete
- How To Delete Unwanted Boot Menu Itemsdeleteboot
- sql:delete if exists還是drop if exists?SQLdelete