interview-answe
                                
                                
                                
                                    interview-answe copied to clipboard
                            
                            
                            
                        🌍 前端程序员训练 求星星 ✨ 各位同学可以在issues中提问,无论是实际项目中遇到的问题,或者是技术问题都可以, 大家一起解决💯 👍 😄。
共同点:用于浏览器端存储的缓存数据 不同点: (1)、存储内容是否发送到服务器端:当设置了 `Cookie` 后,数据会发送到服 务器端,造成一定的宽带浪费;`web storage`,会将数据保存到本地,不会造成宽 带浪费; (2)、数据存储大小不同:`Cookie` 数据不能超过 `4K`,适用于会话标识;`web storage` 数据存储可以达到 `5M`; (3)、数据存储的有效期限不同:`cookie` 只在设置了 `Cookid` 过期时间之前一直 有效,即使关闭窗口或者浏览器;` sessionStorage`,仅在关闭浏览器之前有效; `localStorage`,数据存储永久有效; (4)、作用域不同:`cookie` 和 `localStorage` 是在同源同窗口中都是共享的; `sessionStorage` 在不同的浏览器窗口中共享,即使是同一个页面。
Unit testing is the lowest level of testing to be done during the software development process, where separate units of the software are tested in isolation from the rest of...