When we have $ctrl
created by $componentController
, how to mock static members of a class?
let $ctrl = $componentController("funny-component", null);
When we have $ctrl
created by $componentController
, how to mock static members of a class?
let $ctrl = $componentController("funny-component", null);
For people who use Angular, calling $timeout(fn)
without a second parameter is a very familiar way of deferring execution.
But what about in plain JavaScript?
What is “Tagged Template Literals”, or “Tagged Templates”?
Let’s take a look at a simplified version of MDN’s very confusing example [1].
Every object in JavaScript inherits a valueOf()
method from Object.prototype
. But when we say obj.valueOf()
, what exactly do we mean, the value of an object?
There are multiple ways to churn out a string version of a variable. Take Arrays for example, there are 3: join
, toString
, toLocaleString
.
But what’s the difference?
Normally JavaScript functions can’t remember things. They’re just processes that eat inputs and poop outputs. In, out, gone. No trace left in them. If you were to ask them to personally keep count of the number of times they’ve executed, they would stare back at you with blank, sad eyes.
While closure, simply put, is a JavaScript function that carries its own persistent, private variables [1][2].
If the format of the JSON file is not strictly JSON, it would not work.
Find max_line_length
in your coffeelint.json
file:
Error trigger: it’s a known feature of Chrome 10, if required
is present in input [1].