ReferenceError: _ is not defined | Community
Skip to main content

ReferenceError: _ is not defined

  • June 30, 2018
  • 1 reply
  • 0 views

I am worrying why this error is coming. I am using plain javascript. I found some code from google. and it started giving me error "calculator: 2166 Uncaught ReferenceError: _ is not defined".

Best Courses Online

Please let me know why it is used here.

var n = 20;
output_without_subsidy = _ * n;

 

Posted in Javascript

 
This topic has been closed for replies.

1 reply

Trapta
  • June 30, 2018

Hi @devquora,

Try adding Underscore.js or LoDash.js as a dependency in your code.

Thanks