Skip to content

Instantly share code, notes, and snippets.

@leipreachan
leipreachan / simple.js
Last active February 17, 2025 09:29
different solutions to check for duplicates
const hasDuplicateOneline = (array) =>
new Set(array).size != array.length;
const hasDuplicateAlternative = (arr) =>
arr.some((value, index, origin) => origin.indexOf(value) !== index);
let z = [];
for (let i = 0; i < 10_000; i++) {
z.push(i);
}
POST http://localhost:4444/wd/hub/session/b01c879e-160a-49f9-968c-9e451a0f8eb3/actions
Content-Type: application/json;charset=utf-8
{
"actions": [
{
"type": "key",
"id": "keyboard_1",
"actions": [
{
{
"capabilities": {
"alwaysMatch": {
"browserVersion": "59.0",
"enableVNC": true,
"acceptInsecureCerts": true,
"moz:firefoxOptions": {
"log": {
"level": "debug"
}
javascript:(function(){
function attribute(e, t, n) {
e.setAttribute(t, n)
}
function highlight(r) {
for (var i = 0; i < r.length; i++) {
e = r[i];
try {
e.os = e.getAttribute('style');
attribute(e, 'style', e.os + ';border:2px dashed red;')