Post #2981913
2026-02-15 16:18 UTC
Replies (4)
-
@blinry@chaos.social 2026-02-15 16:22
There's a couple more, like copy(), which copies its argument to your clipboard, or keys(), an abbreviation for Object.keys(). If you ever forget these console helpers, you can run :help to open the page of the documentation that explains them! https://firefox-source-docs.mozilla.org/devtools-user/web_console/helpers/
-
@martijn@mastodon.content.town 2026-02-15 17:25
@blinry@chaos.social That's very Perl-like!
-
@jetcool@mastodon.social 2026-02-15 17:28
@blinry@chaos.social you can right-click an element and "Use in Console" will create a temporary variable with that element
-
@ellnix@fosstodon.org 2026-02-15 20:05
@blinry@chaos.social ruby's irb and python have the same feature with the _ variable! IRB: irb(main):001> 5 + 2 => 7 irb(main):002> _ => 7 Python also seems to avoid overriding _ when your statement returns None: >>> 5 + 2 7 >>> _ 7 >>> print("hello world") hello world >>> _ # still 7! 7 >>> None >>> _ # still 7! 7