- Trending Categories
- 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
Found 8895 Articles for Front End Technology
212 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 var property_value = Math.LOG2E document.write("Property Value is : " + property_value);
209 Views
To get the Natural logarithm of 10, use the Math.LN10 property in JavaScript. It returns the natural logarithm of 10, which is approximately 2.302.You can try to run the following code to get Natural logarithm of 10:Example Live Demo JavaScript Math LN10 Property var property_value = Math.LN10; document.write("Property Value: " + property_value);
191 Views
To get the Natural logarithm of 2, use the Math.LN2 property in JavaScript. It returns the natural logarithm of 2, which is approximately 0.693.ExampleYou can try to run the following code to get Natural logarithm of 2 −Live Demo JavaScript Math LN2 Property var property_value = Math.LN2 document.write("Property Value is : " + property_value); OutputProperty Value is : 0.6931471805599453
622 Views
To get Euler’s constant value in JavaScript, use the Math E property. This is a Euler's constant and the base of natural logarithms, approximately 2.718.ExampleYou can try to run the following code to get Euler’s constant value in JavaScript −Live Demo JavaScript Math E Property var property_value = Math.E document.write("Property Value is :" + property_value); OutputProperty Value is :2.718281828459045
207 Views
To get the difference between two arrays in JavaScript, try to run the following code. Here, we’re using some method like split(), indexOf(), sort(), etc to get the elements, which aren’t the same in both the arrays &mnus;ExampleLive Demo JavaScript Dates function arrDifference (arr1, arr2) { var arr = []; arr1 = arr1.toString().split(', ').map(Number); arr2 = arr2.toString().split(', ').map(Number); // ... Read More
1K+ Views
You can use PHP array in JavaScript. It works for a single as well as the multidimensional array. Use the json_encode() method to achieve this.The following is the Multi-dimensional PHP array.$myArr= array( array('Amit', 'amit@example.com'), array('Rahul, 'rahul@example.com'), );Converting PHP multidimensional array into JavaScript. var arr = ; Now, let’s finally learn how to access it to output the email.document.write(arr[1][1]);
12K+ Views
In this tutorial, we will learn to convert JavaScript seconds to minutes and seconds. The problem is that we have given the total number of seconds, and we need to represent it in the minutes and second format. We can perform some basic Mathematics operations and solve our problems. Here, we have two different ways to convert the seconds to minutes and seconds. Using the Math.floor() Method In this approach, we will use the Math.floor() method. We will divide the total number of seconds by 60 to convert it into the minutes and apply the Math.floor() method to round down ... Read More
3K+ Views
You can use PHP array in JavaScript. It works for the single as well as the multidimensional array. Use the json_encode() method to achieve this.Let’s say Our PHP array is −$myArr = array('Amit', 'amit@example.com');Converting PHP array into JavaScript. var arr = ; Now, let’s finally learn how to access it to output the email −document.write(arr[1]);
30K+ Views
In this tutorial, we will look at how to get the first and last date of the current month using JavaScript. In our daily lives, we frequently deal with dates, and we typically are aware of the day—or, at the very least, the month—we are in. To assist users in determining when something has occurred or will occur concerning their current situation, we display the name of a day or a month. This serves as a wonderful chronology. Following are the approaches to get the first and last date of the month using JavaScript − Using a Date Object ... Read More
774 Views
In the given problem statement we will write a function to calculate the days between the given dates with the help of Javascript functionalities. For solving this problem we will use some built in method of Javascript and mathematical operations. Understanding the problem statement In the given problem we have to create a function to compute the number of days as outcome after calling the function by passing two dates. And this task can be done using Date object and basic math. For example if we have two dates like 2023-02-15 and 2023-02-25, so between these dates there are 10 ... Read More