Categories > Coding > Javascript >
How does Babel work?
Posted
Is there a converter? Or do you just put it in the <script> tag In HTML?
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.
Cancel
Post
My new discord is Wabz#1337 with ID 777154062789509130
Replied
Well I was wondering if you could use already written babel code and convert it into normal js
Cancel
Post
My new discord is Wabz#1337 with ID 777154062789509130
My new discord is Wabz#1337 with ID 777154062789509130
Replied
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)
})
Cancel
Post
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
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
Replied
Im experienced with js and i never heard of babel xD
i guess i like node.js better than native js
Cancel
Post
JustMarie#0709
Â
Users viewing this thread:
( Members: 0, Guests: 1, Total: 1 )
Cancel
Post