Ready. Start with one instruction.
Loading the learning workspace…
FROM YOUR FIRST INSTRUCTION TO A WORKING APPLICATION
Learn JavaScript from scratch through small working examples, visual experiments and complete projects. No account or AI key required.
Predict → Experiment → Build → Test → Explain
Ready. Start with one instruction.
Loading the learning workspace…
An object groups named properties inside braces. In the literal {name: "Alex"}, name is a property key and "Alex" is its value. A colon connects them; commas separate additional properties. Dot notation reads a known property name, so person.name uses the name property rather than an array position. An object’s braces describe data, while a function’s braces describe a block of instructions. Empty text is still a present property value. Nested objects and dynamic keys follow in later lessons.
function solve(person) {
return person.name;
}
console.log(solve({"name":"Alex"}));Alex
An object groups named properties inside braces. In the literal {name: "Alex"}, name is a property key and "Alex" is its value. A colon connects them; commas separate additional properties. Dot notation reads a known property name, so person.name uses the name property rather than an array position. An object’s braces describe data, while a function’s braces describe a block of instructions. Empty text is still a present property value. Nested objects and dynamic keys follow in later lessons.
function solve(person) {Declare a function with a parameter receiving the actual argument supplied by each call. The definition does not execute its body yet.
return person.name;Evaluate this expression, end the function and give the resulting value to its caller. It is not automatically printed.
}Close the current instruction block.
console.log(solve({"name":"Alex"}));Evaluate the argument and display its value at this point. Quoted text is literal; an unquoted identifier reads its current binding.
function solve(person) {
return person.name;
}
console.log(solve({"name":"Mina"}));Mina
An object groups named properties inside braces. In the literal {name: "Alex"}, name is a property key and "Alex" is its value. A colon connects them; commas separate additional properties. Dot notation reads a known property name, so person.name uses the name property rather than an array position. An object’s braces describe data, while a function’s braces describe a block of instructions. Empty text is still a present property value. Nested objects and dynamic keys follow in later lessons.
function solve(person) {Declare a function with a parameter receiving the actual argument supplied by each call. The definition does not execute its body yet.
return person.name;Evaluate this expression, end the function and give the resulting value to its caller. It is not automatically printed.
}Close the current instruction block.
console.log(solve({"name":"Mina"}));Evaluate the argument and display its value at this point. Quoted text is literal; an unquoted identifier reads its current binding.
function solve(person) {
return person.name;
}
console.log(solve({"name":""}));No console output.
An object groups named properties inside braces. In the literal {name: "Alex"}, name is a property key and "Alex" is its value. A colon connects them; commas separate additional properties. Dot notation reads a known property name, so person.name uses the name property rather than an array position. An object’s braces describe data, while a function’s braces describe a block of instructions. Empty text is still a present property value. Nested objects and dynamic keys follow in later lessons.
function solve(person) {Declare a function with a parameter receiving the actual argument supplied by each call. The definition does not execute its body yet.
return person.name;Evaluate this expression, end the function and give the resulting value to its caller. It is not automatically printed.
}Close the current instruction block.
console.log(solve({"name":""}));Evaluate the argument and display its value at this point. Quoted text is literal; an unquoted identifier reads its current binding.
Repair the intentionally changed operation so the example produces the exact expected result. Then try the extension without copying the answer.
function solve(person) {
return person.title;
}
console.log(solve({"name":"Alex"}));function solve(person) {
return person.name;
}
console.log(solve({"name":"Alex"}));An object property name is not an array index. Match the actual key in the supplied record.
Which operation changed the result, why did it work, and what would you test next?
Use a different value that could expose a boundary or mistake. Predict the result first, run it, and explain how the concept would help in a small real application.
Related: Previous lesson Next lesson
100 lessons across 20 modules, covering variables, operators, strings, conditions, loops, functions, scope, arrays, objects, DOM, events, state, testing, asynchronous JavaScript and application development.