Skip to main content

function in javascript

 here in this blog we are going to study about function in javascript


repel for functions(fb login)


so here is the code as follows

// function in javascript

function oneplusavg(x,y) {

  console.log("done")

  return Math.round(1+(x+y)/2)

}


// modern function writing way

// this is arrow function

const hello = ()=>{

  console.log("arey maza aa gaya bhai")

}


let a=1;

let b=2;

let c=3;

hello();

console.log("one plus average of a and b is ", oneplusavg(a,b))

console.log("one plus average of b and c is ", oneplusavg(b,c))

console.log("one plus average of a and c is ", oneplusavg(a,c))



Comments

Popular posts from this blog

How to add the treeview numbers to get the grand total in tkinter entry box

 in this blog we are going to know about the adding of the integers in the treeview and get the total in the entry box of tkinter so here is the image first so the coding to do such things are here as follow but here is the condition that pls make assured that the state of entry box is disabled.......      for child in my_tree1 . get_children ():         e2l . config ( state = "normal" )         b1 += float ( my_tree1 . item ( child , "values" )[ 3 ])         var2 . set ( b1 )         e2l . config ( state = "disable" )      l2l = Label ( ento , text = "Purnea-2" , width = 8 )      l2l . grid ( row = 0 , column = 1 )     e2l = Entry ( ento , textvariable = var2 , state = "disable" , width = 8 )     e2l . grid ( row = 1 , column = 1 )