Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

422
Views
Corrección: esperaba una asignación o llamada de función y en su lugar vio una expresión

Estoy tratando de corregir este error de Eslint:

 Expected an assignment or function call an instead saw an expression

¿Alguna idea sobre cómo puedo acomodar el código para que no me dé ese error al seguir el código de muestra?

 window.matchMedia || (window.matchMedia = function() { if (!styleMedia) { const style = document.createElement('style'); const script = document.getElementsByTagName('script')[0]; let info = null; style.type = 'text/css'; style.id = 'matchmediajs-test'; script.parentNode.insertBefore(style, script); info = ('getComputedStyle' in window) && window.getComputedStyle(style, null) || style.currentStyle; styleMedia = { matchMedium: function(media) { const text = '@media ' + media + '{ #matchmediajs-test { width: 1px; } }'; if (style.styleSheet) { style.styleSheet.cssText = text; } else { style.textContent = text; } return info.width === '1px'; }, }; } return function(media) { return { matches: styleMedia.matchMedium(media || 'all'), media: media || 'all', }; }; }());

¿Alguna idea de por qué recibo este error de pelusa?

Gracias

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Su primera línea (que encierra todo el guión, en realidad)

 window.matchMedia || (window.matchMedia = function() {

es una expresión, no una asignación o llamada de función. En su lugar, necesita algo como:

 if (!window.matchMedia) { window.matchMedia = function() { // .. }

en lugar de asignar dentro del condicional.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!