Forem

Cover image for top 3 JavaScript one-liners
Atharva Shankar avhad
Atharva Shankar avhad

Posted on

4

top 3 JavaScript one-liners

JavaScript is very fun language. Like it is more simple and superior that python, ok. I am not that python is bad, but can python do this

img

1. console.log(console)

console.log(console)

OUTPUT:

: 
ƒ assert()
clear
: 
ƒ clear()
context
: 
ƒ context()
count
: 
ƒ count()
countReset
: 
ƒ countReset()
createTask
: 
ƒ createTask()
debug
: 
ƒ debug()
dir
: 
ƒ dir()
dirxml
: 
ƒ dirxml()
error
: 
ƒ error()
group
: 
ƒ group()
groupCollapsed
: 
ƒ groupCollapsed()
groupEnd
: 
ƒ groupEnd()
info
: 
ƒ info()
log
: 
ƒ log()
memory
: 
MemoryInfo {totalJSHeapSize: 64942465, usedJSHeapSize: 51569489, jsHeapSizeLimit: 2095841280}
profile
: 
ƒ profile()
profileEnd
: 
ƒ profileEnd()
table
: 
ƒ table()
time
: 
ƒ time()
timeEnd
: 
ƒ timeEnd()
timeLog
: 
ƒ timeLog()
timeStamp
: 
ƒ timeStamp()
trace
: 
ƒ trace()
warn
: 
ƒ warn()
Enter fullscreen mode Exit fullscreen mode

its pretty crazy. you can mess with it here is the blog for more information:thanks Jai-dewani

2. document.designMode = on

Oh my god this is the best one here. literally list can stop here.
this make your website or any website customizable.

  1. go to youtube
  2. inspect document and click console tab.
  3. type document.designMode = on
  4. and click on any text and press backspace. 4.type anything gibberish.

img

3(and last one). windows.open()

this is also crazy. this thing makes a browser for you. don't believe me just try it.

let win = window.open("https://www.youtube.com/@atharvashankar","my web Browser","width-300,height-300")
Enter fullscreen mode Exit fullscreen mode

conclusion

these one liner can change whole website. and remember chrome can give you security warnings. but just ignore it.

bye!

check out my youtube channels:-Main,

extras,

shorts,

also check me out on hashnode :-all blogs are here also

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more →

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay