JavaScript代码在线执行
实时运行JavaScript代码,查看执行结果和控制台输出
代码编辑器
执行结果
点击"执行代码"按钮运行JavaScript代码
代码示例
基础输出
console.log('Hello World');
数组操作
const arr = [1,2,3,4,5];
arr.map(x => x * 2)
对象遍历
const obj = {a: 1, b: 2};
Object.entries(obj)
字符串处理
const str = 'hello world';
str.toUpperCase()
JSON操作
const data = {name: 'John'};
JSON.stringify(data)
日期时间
new Date().toLocaleString()