"JavaScript online live class available in Hindi & Marathi for automation testing with Cypress, Enroll Here"
See below code and practice to run it in VS code or Online JS compiler.
//* basic types of function *//
//1) without parameters and without return type
function Tuljapur(){
console.log("hello")
}
Tuljapur()
//2) with parameters and without return type
function Solapur(x,y){
console.log(x+y)
}
Solapur(100,200)
//3) with parameters and with return type
function Dharashiv(x,y){
return x * y
}
let aa1 = Dharashiv(5,4)
console.log(aa1)
console.log(aa1*6)
//* different ways of writing function *//
//1) function declaration
function addA(x,y){
return x + y
}
let a1 = addA(20,30)
console.log(a1)
//2) function expression
let addB = function(x,y){
return x + y
}
let a2 = addB(50, 40)
console.log(a2)
//3) arrow function
let addC = (x,y)=>{
return x + y
}
let a3 = addC(60,40)
console.log(a3)
----------------------------------
types of functions in javascript with example, how many types of functions in javascript, javascript functions examples, different ways to define a function in javascript, learn javascript online in Hindi, in Marathi
टिप्पण्या
टिप्पणी पोस्ट करा
आपल्या प्रतिक्रियेबद्दल धन्यवाद ! आम्ही लवकरात लवकर प्रतिक्रियेला उत्तर देण्याचा प्रयत्न करू