javascript - How can a parameter exist when no argument is passed? -


i'm new javascript, although have .net background. typically in .net (as many other languages), if method requires parameter passed, have pass (or else compiler error due incorrect signature). appears case in javascript, not cases appear.

this doesn't appear case in javascript.

as working example, please refer line 61

http://www.humblesoftware.com/flotr2/#!basic-axis

line 61 tickformatter: ticksfn,

i understand tickformatter calling function called ticksfn line 29 shows

function ticksfn(n) {     return '(' + n + ')'; } 

'ticksfn' requires value (n) passed, yet, never pass it.

despite that, javascript still gets right , can't find out how, nor can work/understand search more research

you never call @ all. pass function argument (or rather value of property of object argument).

graph = flotr.draw(container, [ /* ... */], {       xaxis : {         noticks : 7,              // display 7 ticks.         tickformatter : ticksfn,  // displays tick values between brackets.         // … 

your third party library code responsible calling function, , argument.


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -