Skip to content
This repository was archived by the owner on Nov 14, 2019. It is now read-only.
This repository was archived by the owner on Nov 14, 2019. It is now read-only.

console.find(where, what) #5

@NV

Description

@NV

Or console.grep, or console.filter. I don't know yet.

Objects:

obj = {
  a: 1,
  b: {c: [1, "buz"]}
}

>>> console.find(obj, 1)
-> [obj.a, obj.b.c]
>>> console.find(obj, [1, "buz"])
-> obj.b.c

DOM:

<body>
  <p>Fuuuuuuuu!</p>
  <p>Bar.</p>
</body>

>>> console.find(document.body, function(e){
  return e.textContent.indexOf('Fuu') === 0
}
->  <p>Fuuuuuuuu!</p>

Inspired by method_finder.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions