Sravani S has Published 90 Articles

HTML5 IndexedDB Example

Sravani S

Sravani S

Updated on 29-Jan-2020 10:13:33

159 Views

The following function is an example of IndexedDB to add data:function add() {    var request = db.transaction(["employee"], "readwrite")    .objectStore("employee")    .add({ id: "001", name: "Amit", age: 28, email: "demo1@example.com" });    request.onsuccess = function(event) {       alert("Amit has been added to your database.");    };   ... Read More

How to get last day of the current month in MySQL?

Sravani S

Sravani S

Updated on 29-Jan-2020 05:17:54

306 Views

With the help of following MySQL query, we can get the last day of the current month −mysql> SELECT LAST_DAY(now()) AS 'LAST DAY OF CURRENT MONTH'; +---------------------------+ | LAST DAY OF CURRENT MONTH | +---------------------------+ | 2017-10-31                | +---------------------------+ 1 row in set (0.00 sec)

In MySQL, how can I convert a number of seconds into TIMESTAMP?

Sravani S

Sravani S

Updated on 28-Jan-2020 10:44:24

728 Views

It is exactly reverse of UNIX_TIMESTAMP() and can be done with the help of FROM_UNIXTIME() function. For example, 11576070 seconds would be TIMESTAMP ‘1970-05-15 05:04:30’.mysql> Select FROM_UNIXTIME(11576070); +--------------------------------+ | FROM_UNIXTIME(11576070)        | +--------------------------------+ |      1970-05-15 05:04:30       | +--------------------------------+ 1 row in set (0.00 sec)

Why JavaScript Data Types are Dynamic?

Sravani S

Sravani S

Updated on 16-Jan-2020 10:18:32

126 Views

JavaScript also has dynamic types. That would mean the same variable used for holding different data types in JavaScript.Example                    var val;          val = "Amit";          document.write("String: "+val);          val = 20;          document.write("Number: "+val);          val = 40.90;          document.write("Number with decimals: "+val);                  

How to get base 2 logarithm of E in JavaScript?

Sravani S

Sravani S

Updated on 16-Jan-2020 07:29:51

198 Views

To get base 2 logarithms of E, use the Math LOG2E property. It returns base 2 logarithm of E which is approximately 1.442.ExampleYou can try to run the following code to get base 2 logarithms of E in JavaScript:           JavaScript Math LOG2E Property     ... Read More

How to append an item into a JavaScript array?

Sravani S

Sravani S

Updated on 13-Jan-2020 10:22:22

150 Views

To append an item to a JavaScript array, use the push() method.ExampleYou can try to run the following code to append an item:Live Demo                    var arr = ["marketing", "technical", "finance", "sales"];          arr.push("HR");          document.write(arr);           Outputmarketing,technical,finance,sales,HR

How to use typeof with arguments in JavaScript?

Sravani S

Sravani S

Updated on 09-Jan-2020 06:28:04

638 Views

Arguments object is the arguments passed to a function. It is a variable accessible for all functions. Let’s say two arguments are passed to a function, then you can access them like the following:arguments[0] arguments[1]In the same way, you can use a type of with arguments in JavaScript. Firstly, let’s ... Read More

Why are "continue" statements bad in JavaScript?

Sravani S

Sravani S

Updated on 08-Jan-2020 10:20:39

553 Views

The usage of “continue” statement makes the code difficult to understand. In most cases, the usage of continue would mean you have an insufficient condition in your loop. To avoid this, you can add it to the condition itself or use if in a loop.But, “continue” is bad if it ... Read More

How JavaScript was created?

Sravani S

Sravani S

Updated on 02-Jan-2020 08:00:13

97 Views

NCSA’s Mosaic was the first popular browser, which released in 1993. After a year, in 1994, Netscape was founded, which came with the web browser Netscape Navigator It gained a lot of popularity in the 1990s. Many Mosaic authors worked for Navigator.Considering the need for users and market trend, Netscape ... Read More

Which equals operator (== vs ===) should be used in JavaScript comparisons

Sravani S

Sravani S

Updated on 12-Sep-2019 07:10:20

76 Views

Double equals (==) is abstract equality comparison operator, which transforms the operands to the same type before making the comparison.For example, 4 == 4     // true '4' == 4   // true 4 == '4'   // true 0 == false // trueTriple equals (===) are strict equality ... Read More

Advertisements