Dive into these digital sandboxes and tinker with live code! It's like Lego, but for geeks. No shoes required, just bring your curiosity! 🧩💻
This example demonstrates how to fetch data from an external API using Axios.
Fetched data: { userId: 1, id: 1, title: 'delectus aut autem', completed: false }
Todo ID: 1
Title: delectus aut autem
Completed: false
User ID: 1
Updated todo: { userId: 1, id: 1, title: 'delectus aut autem', completed: true }
Related todos: [
{ id: 2, title: 'Related todo 1', completed: false, userId: 1 },
{ id: 3, title: 'Related todo 2', completed: false, userId: 1 },
{ id: 4, title: 'Related todo 3', completed: false, userId: 1 },
{ id: 5, title: 'Related todo 4', completed: false, userId: 1 },
{ id: 6, title: 'Related todo 5', completed: false, userId: 1 }
]undefined
This example shows how to use map and filter functions to manipulate arrays.
Doubled numbers: [2, 4, 6, 8, 10, 12, 14, 16, 18, 20] Even numbers: [2, 4, 6, 8, 10] Squares of odd numbers: [1, 9, 25, 49, 81] Sum of all numbers: 55
undefined
This example demonstrates object manipulation and destructuring techniques.
Destructured properties: { name: 'John Doe', age: 30, profession: 'Developer' }
Nested destructuring: { city: 'Anytown', country: 'USA' }
Updated person: {
name: 'John Doe',
age: 31,
profession: 'Developer',
address: { street: '123 Main St', city: 'Anytown', country: 'USA' },
skills: [ 'JavaScript', 'React', 'Node.js' ]
}
Calculator results:
Addition: 15
Subtraction: 5
Multiplication: 50
Division: 2
Division by zero: Cannot divide by zeroundefined
This example free for you. Nothing to do here.