Skip to content

Overview

jakenester31 edited this page Aug 5, 2025 · 13 revisions

Global

$(val)

scans the dom list for the first matching element

  • val : an html selector tag

$$(val)

scans the dom list for all matching elements

  • val : an html selector tag

Proxy

has(trg)

checks if the target (trg) is a proxy object and returns a boolean

  • trg : an object

targetOf(proxy)

returns a reference to the proxy’s target or undefined if the object is not a proxy

  • proxy : a proxy object

Object

checkGroup(sign,func)

run multiple check functions with the same sign – tip : while defining a sign in a check function is not required in a checkGroup, it is still allowed

  • sigh : the sign all check function in func use by defualt
  • func : a function containing a body of code with check function(s)

Object.prototype

entrify(name,func)

runs name func on this after Object.entries runs and then runs Object.fromEntries

entrify()

converts an object into a plain object

  • this : object to run name func on
  • name : the name of the function being executed, ex. filter or map
  • func : the function contents

replaceThis(obj)

removes all the properties of this and adds all the properties of obj into this

  • this : object to replace
  • obj : object used to replace

$(…path)

scans through this using path, returning the item from the path

  • this : object to scan
  • …path : the path (array) used to find a (nested) item within this

check(sign,b,c)

evaluates a statment, returning c if true otherwise the original passed values

check(b,c)

uses default sign if in a checkGroup function – tip: when assigning to a variable, wrap it in an array: [a] = a.check(1,2); otherwise the returned value(s) aren’t unwrapped

  • this (a) : the value/variable(s) to check
  • sign : the conditional sign to use, ex. ===, >, <=, !=
  • b : the value(s) checking to a
  • c : the result(s) if true

Array

new(length,map)

creates a new array using a map and length

  • length : the length of the new array
  • map(index) : the function used to determine each individual items value
    • index : the index of the current item being mapped

Array.prototype

clearHoles()

removes empty slots in this

  • this : an array (with empty slots) needing to be cleaned

keySeg()

creates an object containing the indexes and normal properties of an array

addNext(length,map)

adds new items to an Array using a the map

  • length : the amount of items
  • map(last) : the function used to determine each new items value
    • last : the value of the item before

Number.prototype

range(min,max,mode)

determines if this is within the range

  • this : the value being checked to see if its within the range
  • min : the minimum point in the range (can swap with max)
  • max : the maximum point in the range (can swap with min)
  • mode[‘on’,’within’] : determines if this can be on the edge of the range or not
    • ‘on’ : this can be on the edge of the range
    • ‘within’ : this cannot be on the edge of the range

centerRange(mid,range,mode)

determines if this is within the range

  • this : the value being check to see if its within the range
  • mid : the middle of the range
  • range : the size/radius of the range
  • mode[‘on’,’within’] : determines if this can be on the edge of the range or not
    • ‘on’ : this can be on the edge of the range
    • ‘within’ : this cannot be on the edge of the range