Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 ALL


  Undefined property or variable in JavaScript

JavaScript is a weak type language, and also you can use a variable or property where it's undefined. If we don't have correct ways to check whether a property or variable is defined, we may get unexpected results when we try to access the,. How can we check whether a property or variable is undefined?This is actually a somewhat tricky question. Let's start off with some facts about undefined and then see what kind of function is consistent with the ones we care about.JavaScript attaches types to values, not variables. Values can have type undefined; variables either exist (if declared) or the...

11,480 0       JAVASCRIPT ARRAY PROPERTY UNDEFINED


  You can get properties of pseudo-element using JavaScript now

The pseudo-element6 in CSS is extremely useful, you can use it to create CSS triangles and lots of other elements without overuse many HTML elements. In the past, you cannot get the property value of pseudo-element in CSS using JavaScript. Now you can call a new method in JavaScript to get them easily.Assume you have below CSS codes:.element:before { content: 'NEW'; color: rgb(255, 0, 0);}To get the properties in .element:before, you can use below JavaScript method:var color = window.getComputedStyle( document.querySelector('.element'), ':before').getPropertyValue('color')You can put the pseud...

8,360 0       JAVASCRIPT PROPERTY PSEUDO-ELEMENT


  ECMAScript 5 Objects and Properties

ECMAScript 5 is on its way. Rising from the ashes of ECMAScript 4, which got scaled way back and became ECMAScript 3.1, which was then re-named ECMAScript 5 (more details)- comes a new layer of functionality built on top of our lovable ECMAScript 3.Update: I've posted more details on ECMAScript 5 Strict Mode, JSON, and More.There are a few new APIs included in the specification but the most interesting functionality comes into play in the Object/Property code. This new code gives you the ability to dramatically affect how users will be able to interact with your objects, allowing you to provid...

1,152 0       ECMASCRIPT OBJECT PROPERTY