1. Rules vs examples
Normal programming: you write the rules. if (sweetness > 6) return "mango";
Machine learning: you give the computer many examples with answers, and it finds the rule itself. That “found rule” is called a model.
In this course you will build tiny models in plain JavaScript — no libraries, no magic. You need a little JavaScript: arrays, objects, loops and functions. Rusty? Revise with our JavaScript course. Never coded at all? Start with AI Shiksha, our no-code AI literacy course, and come back later.
// A hand-written rule (no learning yet)
function guess(fruit) {
if (fruit.sweetness > 6) return "mango";
return "lemon";
}
console.log(guess({ weight: 220, sweetness: 9 }));
console.log(guess({ weight: 60, sweetness: 2 }));