- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Mkotla has Published 100 Articles
Why in JavaScript, “if ('0' == false)” is equal to false whereas it gives true in “if(0)” statement?
mkotla
1K+ Views
Let’s see the conditions one by one − if(‘0’ == false)It follows the following rule −If Type(y) is Boolean, return the result of the comparison x == ToNumber(y)The == does type coercion. This means an explicit type conversion is requested to match the type of the two operands. The left side ... Read More
mkotla
89 Views
The void operator is used to evaluate the given expression. After that, it returns undefined. It obtains the undefined primitive value, using void(0) i.e. 0 as an argument.The void(0) can be used with hyperlinks to obtain the undefined primitive value, ExampleLive Demo Understanding JavaScript ... Read More
mkotla
2K+ Views
To customize the position of an alert box, use the CSS “top” and “left” properties. We have a custom alert box, which we’ve created using jQuery and styled with CSS.ExampleYou can try to run the following code to customize the position of an alert box −Live Demo ... Read More
mkotla
3K+ Views
With JavaScript, to set more than one cookie, set document.cookie more than once using the; separator.ExampleYou can try to run the following code to set multiple cookies −Live Demo var num=1; function addCookie() { ... Read More
mkotla
2K+ Views
The following global error handler will show how to catch unhandled exception −Example window.onerror = function(errMsg, url, line, column, error) { var result = !column ? '' : 'column: ' + column; result += !error; document.write("Error= " + errMsg + "url= " + url + "line= " + line + result); var suppressErrorAlert = true; return suppressErrorAlert; }; setTimeout(function() { eval("{"); }, 500)
mkotla
1K+ Views
The date picker in HTML5 basically works very similar to how the JavaScript Libraries did, when we focus on the field a calendar will pop out, and then we can navigate through the months and years to select the date.Therefore, if you want the date input to use more spacing ... Read More
mkotla
131 Views
You can access a dictionary value to a variable in Python using the access operator []. examplemy_dict = { 'foo': 42, 'bar': 12.5 } new_var = my_dict['foo'] print(new_var)OutputThis will give the output −42You can also access the value using the get method on the dictionary. examplemy_dict = { 'foo': 42, ... Read More
mkotla
3K+ Views
Use the following to check if audio is playing −functionisPlaying(audelem) { return!audelem.paused; }The above code can be used to check ifaudio is playing or not. The audio tag has a paused property.The paused property returns whether the audio/video is paused.You can also toggle −functiontogglePause() { if(newAudio.paused && newAudio.currentTime > 0 ... Read More