Question discussion

Which of the following are valid function names? 1. function() 2. () 3. .function() 4. $function()

280592Medium 1 reply 2,564 views
32
Which of the following are valid function names? 1. function() 2. () 3. .function() 4. $function()
  • AOnly 2
  • BNone of the mentioned
  • CAll of the mentioned
  • D3 and 4
Correct answer: A

Discussion 1

0
CCommunity
Only 2

Except a) others are invalid names. According to the specified regular expression ([a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*), a function name like this one is valid.