Forums > Javascript >

How does Babel work?


Moon

Moon

moderator

Posts: 6769

Threads: 240

Joined: Aug, 2020

Reputation: 51

Posted

Is there a converter? Or do you just put it in the <script> tag In HTML?

Join the Lounge: https://discord.gg/zVnT5DfAMR - Not for Exploiting
M
o
o
o
o
o
o
o
o
o

o
o
o
o
o
o
o
o
o
o
o
o
o
o
o

o
o
o
o
o
o
o
o
o
o
o
n
Stop using Dark mode

Wabz

Winning.js

Posts: 2535

Threads: 193

Joined: Apr, 2020

Reputation: 24

Replied

Babel transpiles (converts) the code into JS code but if I was you I wouldn't use babel unless I was experienced with JS already.

My new discord is Wabz#1337 with ID 777154062789509130

Moon

Moon

moderator

Posts: 6769

Threads: 240

Joined: Aug, 2020

Reputation: 51

Replied

@Wabz

Well I was wondering if you could use already written babel code and convert it into normal js

Join the Lounge: https://discord.gg/zVnT5DfAMR - Not for Exploiting
M
o
o
o
o
o
o
o
o
o

o
o
o
o
o
o
o
o
o
o
o
o
o
o
o

o
o
o
o
o
o
o
o
o
o
o
n
Stop using Dark mode

Wabz

Winning.js

Posts: 2535

Threads: 193

Joined: Apr, 2020

Reputation: 24

Replied

@Moon yes you can

My new discord is Wabz#1337 with ID 777154062789509130

Moon

Moon

moderator

Posts: 6769

Threads: 240

Joined: Aug, 2020

Reputation: 51

Replied

@Wabz

Using what?

Join the Lounge: https://discord.gg/zVnT5DfAMR - Not for Exploiting
M
o
o
o
o
o
o
o
o
o

o
o
o
o
o
o
o
o
o
o
o
o
o
o
o

o
o
o
o
o
o
o
o
o
o
o
n
Stop using Dark mode

Wabz

Winning.js

Posts: 2535

Threads: 193

Joined: Apr, 2020

Reputation: 24

Replied

@Moon Using babel itself -_-

My new discord is Wabz#1337 with ID 777154062789509130

Moon

Moon

moderator

Posts: 6769

Threads: 240

Joined: Aug, 2020

Reputation: 51

Replied

@Wabz

Uh okay

Join the Lounge: https://discord.gg/zVnT5DfAMR - Not for Exploiting
M
o
o
o
o
o
o
o
o
o

o
o
o
o
o
o
o
o
o
o
o
o
o
o
o

o
o
o
o
o
o
o
o
o
o
o
n
Stop using Dark mode

AIpha

alpha

Posts: 175

Threads: 23

Joined: May, 2018

Reputation: 4

Replied

@Moon

There's no need. All babel does is transpile newer versions of JS for example ES6 to code which an older version of JS can run without issues for example ES5. Meaning the result of that code is still javascript therefore there is no need to revert it back to its old state unless you really wanted the use of newer properties. All in all babel does the following

--ES6 Input
const array = [69,420]
array.forEach(number => console.log(number ** 2))

--Babel does its transpiling magic 

--ES5 Compatible output
const array = [69,420]
array.forEach(function(x){
  console.log(x ** 2)
})

Was on WRD front page

Programs I own - Synapse X, Protosmasher, Sirhurt, Sweat Heart of Sigma Chi, Scriptware V2

Languages I know - C#,JS,Lua,VB.net
Learning - Python, C

Moon

Moon

moderator

Posts: 6769

Threads: 240

Joined: Aug, 2020

Reputation: 51

Replied

@AIpha

Thanks

Join the Lounge: https://discord.gg/zVnT5DfAMR - Not for Exploiting
M
o
o
o
o
o
o
o
o
o

o
o
o
o
o
o
o
o
o
o
o
o
o
o
o

o
o
o
o
o
o
o
o
o
o
o
n
Stop using Dark mode

AIpha

alpha

Posts: 175

Threads: 23

Joined: May, 2018

Reputation: 4

Replied

@Moon

np my good sir

Was on WRD front page

Programs I own - Synapse X, Protosmasher, Sirhurt, Sweat Heart of Sigma Chi, Scriptware V2

Languages I know - C#,JS,Lua,VB.net
Learning - Python, C

TaxiDriver08

JustMarie

Posts: 1662

Threads: 39

Joined: Dec, 2020

Reputation: 6

Replied

Im experienced with js and i never heard of babel xD

 

i guess i like node.js better than native js

JustMarie#0709

 

Moon

Moon

moderator

Posts: 6769

Threads: 240

Joined: Aug, 2020

Reputation: 51

Replied

@D_tigo

Fat arrows


Seems legit

Join the Lounge: https://discord.gg/zVnT5DfAMR - Not for Exploiting
M
o
o
o
o
o
o
o
o
o

o
o
o
o
o
o
o
o
o
o
o
o
o
o
o

o
o
o
o
o
o
o
o
o
o
o
n
Stop using Dark mode