Posts

Image
  Understanding JavaScript Functions    Introduction JavaScript is the heart of front-end logic . Two of its most important concepts are Functions and Arrays . Understanding these makes you a confident developer who can write clean, reusable, and efficient code. “Functions organize your logic. Arrays organize your data.” JavaScript Functions   What is a Function? A function is a block of code designed to perform a specific task. It runs when it is called or invoked . Function Syntax: function functionName(parameter1, parameter2) {   // code to be executed   return result; } Example 1 — Simple Function f unction greet() {   console.log("Welcome to JavaScript!"); } greet(); // Output: Welcome to JavaScript! Explanation: function greet() → defines the function greet(); → calls the function Example 2 — Function with Parameters function calculateSalary(basic, bonus) {   return basic + bonus; } console.log(calculateSalary(30000, 5000)); ...

SOLID PRINCIPLES IN JAVA SCRIPT

Image
  SOLID PRINCIPLES IN  JAVA SCRIPT who invented the solid principal ? In the year of 2000 Software engineer Robert C.Martin (Uncle bob) Five   key design principalin his paper "Design Principesl&Design Patterns" The principal aimed to improve Object-Oriented Software Design and reduce code rot. Michael Feathers:                                 In year of 2004  Micheal Feathers coined the acronym SOLID  make the 5  Principles eaiser to remember and tech.Since then,SOLID has became a cornerstone of clean code and algile development. What are all the SOLID PRINCIPLES? Each letter in SOLID stands for the principle. Lets break them down with examples: Single Responsibillity Principles (SRP)    A  clean function should have only one reason to change. ex:function saveUser(user){ saveToDB(user); } function notifyUser(user){ sendWelcomeEmail(user); } Why it matters: E...