js函数去重
发表于|更新于
|浏览量:
记一个去重函数
1 | var array = ["ruben", "ruben", "快乐", "阿超", "快乐"] |
输出结果

相关推荐
2024-02-21
用canvas消除锯齿的方式
不和不可以接物,不严不可以驭下。——林逋 分享几种canvas消除锯齿的方式 1. 线条坐标增加0.5123456789<canvas id="canvas1" width="200" height="200"></canvas><script> var canvas = document.getElementById('canvas1'); var ctx = canvas.getContext('2d'); ctx.beginPath(); ctx.moveTo(0, 0.5); // 使用0.5增量对齐像素 ctx.lineTo(200, 0.5); // 绘制一条边缘清晰的直线 ctx.stroke();</script> 2. 使用高清画布1234567891011<canvas id="canvas2" style="width:200px; height:200px...
2022-04-22
css实现鼠标划入显示拖动条
古之立大事者,不惟有超世之才,亦必有坚忍不拔之志。——苏轼 代码如下: 1234567891011121314151617181920212223242526272829<!DOCTYPE html><html> <head> <style> .ruben-container{ height: calc(100vh - 70vh); width: calc(100vw - 70vw); overflow-y: auto; } .ruben-container::-webkit-scrollbar { width: 4px; } .ruben-container::-webkit-scrollbar-thumb{ ...
2024-11-29
shenyu同时支持自定义rulehandler+pluginhandler
月缺不改光,剑折不改刚。——梅尧臣 https://github.com/apache/shenyu-dashboard/pull/511 主要是写了一个公共组件 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "...
2021-05-26
百度地图简单对接
地位越高,自我评价就越高,自信心多强,能力就有多强。我们总能表现出与环境的和谐平等。——赫兹里特 效果如下 跟着官网一步一步来即可 申请成为开发者 然后在应用管理里创建应用 填写信息 点击复制AK 然后复制代码 123456789101112131415161718192021222324252627<!DOCTYPE html> <html><head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Hello, World</title> <style type="text/css"> html{height:10...
2025-03-05
tauri快速开始踩坑
现在我不那么困惑了,因为我幸运地变得比以前麻木了。——梭罗的《瓦尔登湖》 这里我的Rust版本太低了,所以更新了下 终端如下: 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106(base) 2023:~ achao$ cd ~/IdeaProjects/(base) 2023:IdeaProjects achao$ sh <(curl https://create.tauri.app/sh) % Total % Received % Xferd Average Speed Time Time Time Current ...
2025-07-01
antdesign3.x中Form.create之后拿ref
相关PR: https://github.com/apache/shenyu-dashboard/pull/534 文档在此: 表单 Form - Ant Design 经过 Form.create 之后如果要拿到 ref,可以使用 rc-form 提供的 wrappedComponentRef,详细内容可以查看这里。 123456class CustomizedForm extends React.Component { ... }// use wrappedComponentRefconst EnhancedForm = Form.create()(CustomizedForm);<EnhancedForm wrappedComponentRef={(form) => this.form = form} />this.form // => The instance of CustomizedForm 如何在函数组件中拿到 form 实例?#你需要通过 forwardRef 和 useImperativeH...

阿超
我的名字叫阿超 年龄25岁 家在北京市 职业是软件开发 每天最晚也会在八点前回家 不抽烟 酒浅尝辄止 晚上十二点上床 保证睡足八个小时 睡前写一篇博客 再做二十分钟俯卧撑暖身 然后再睡觉 基本能熟睡到天亮 像婴儿一样不留下任何疲劳和压力 就这样迎来第二天的早晨 健康检查结果也显示我很正常 我想说明我是一个不论何时都追求内心平稳的人 不拘泥于胜负 不纠结于烦恼 不树立使我夜不能寐的敌人 这就是我在这社会的生活态度
Follow Me公告
This is my Blog