Home >Web Front-end >JS Tutorial >Can vue and react be run without babel?
Vue and react cannot be run without babel, because the written code needs to be compiled with babel before the browser can recognize it; the compiled vue and react can be run without babel because their code has been processed by babel Converted.
The operating environment of this tutorial: windows7 system, react17.0.1&&vue2.0 version, Dell G3 computer.
Recommended: "JS Basic Tutorial"
Can vue and react be run without babel?
You cannot run vue and react without babel during development, because the written code needs to be compiled with babel before the browser can recognize it; the compiled vue and react can run without babel because their code has been Converted through babel.
Babel is a JavaScript compiler, that is, when you use the latest JavaScript syntax, Babel converts it into browser-compatible JavaScript code through a syntax converter. This allows us to use the new syntax immediately without waiting for browser support.
For example:
// 下一代 JavaScript 语法 [1,2,3].map(n => n+1); // babel转换为浏览器兼容的 JS 代码 [1,2,3].map(function(n){ return n+1; });
The above is the detailed content of Can vue and react be run without babel?. For more information, please follow other related articles on the PHP Chinese website!