Passing long parameters in a constructor function

Passing long parameters in a constructor function
0

#1

hello

how can I pass long parameters inside a function constructor? a parameter with white space in it.

I tried something like that:

  var person = function(name,["last name"]){
             this.name = name,
                 this["last name"]= ["last name"]
         }

is there a way to do that? or last name have to be one word - lastname


#2

Variables can’t have spaces. Please read about variable naming rules and conventions in Javascript.


#3

So you basically want to have a variable / parameter with a space in it? That is definitely not possible (as @yasserhussain1110 just mentioned) . It is best to use camelCase: lastName.