如何解决无法使用 python 版本 Python 3.6.5 安装 opencv-python :: Anaconda, Inc
我有暗网和 opencv4.2.0 和 Ubuntu 18.04
但是我在使用 python 时无法导入 CV2(暗网运行良好)
当我使用 let lists = [
{
id: 'd8t4gf',title: 'Working on',items: [{ title: 'Item 1' },{ title: 'Item 2' },{ title: 'Item 3' }],},{
id: '8jy8g',title: 'Done',{ title: 'Item 2' }],];
const addNewTitleOnTopLevel = (title) => {
const newData = [...lists];
newData.push({id: '123',title});
//Since doing `[...lists]` will do a shallow copy,the lengths will be different;
console.log(newData.length,lists.length);
//The objects are different so,it'll be false.
console.log(newData === lists);
}
const addNewTitleInnerItems = (title,id) => {
const listIndex = lists.findIndex((list) => list.id === id);
const newData = [...lists];
newData[listIndex].items = [newData[listIndex].items,{title}]
//Since `newData[listIndex].items` & `lists[listIndex].items`
//are pointing to same references,their length will be same
console.log(newData[listIndex].items.length,lists[listIndex].items.length);
//To know if they both are same or not
console.log(newData[listIndex].items === lists[listIndex].items);
}
addNewTitleOnTopLevel("test");
addNewTitleInnerItems("test",'8jy8g');
终端显示
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。