Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

110
Vistas
Need some help understanding jQuery code - Function within a function

I need some help understanding some JavaScript code. Here is the code:

MyVar.js:

var MyVar = (function($){

  var _this;
  ...
  
  function myVar()
  {
        _this = this;
  }
  
  myVar.prototype.test()
  {
    console.log("Hello World");
  }
  ...
})(window.jQuery);

From an ASP.NET view:

var myVar = new MyVar();
myVar.test();

I've tried running this code in a JSFiddle example, but I get an error. How exactly does this code work?

Edit:

This is the error I am getting: Uncaught TypeError: myVar.prototype.test is not a function.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda