I have the following JS code:
var func = function (dimension) {
var element,
minSize = "min-" + dimension,
maxSize = "max-" + dimension;
element = jQuery('<div>');
element.css({
maxSize: "",
minSize: ""
});
};
func();
JSHint throws me the following warnings:
Two unused variables
3 minSize
4 maxSize
Why? It is obvious that I'm using them.
you havn't use the variable. you can't use literal object with variable as key. try