What does = +_ mean in JavaScript

前端 未结 12 1740
南笙
南笙 2020-11-22 11:37

I was wondering what the = +_ operator means in JavaScript. It looks like it does assignments.

Example:

hexbin.radius = function(_)         


        
12条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-22 12:44

    I suppose you mean r = +_;? In that case, it's conversion of the parameter to a Number. Say _ is '12.3', then +'12.3' returns 12.3. So in the quoted statement +_ is assigned to r.

提交回复
热议问题