- 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 8894 Articles for Front End Technology
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
668 Views
DNA And RNA RelationDeoxyribonucleic acid, DNA is the primary information storage molecule in biological systems. It is composed of four nucleic acid bases Guanine ('G'), Cytosine ('C'), Adenine ('A'), and Thymine ('T').Ribonucleic acid, RNA, is the primary messenger molecule in cells. RNA differs slightly from DNA its chemical structure and contains no Thymine. In RNA Thymine is replaced by another nucleic acid Uracil ('U').ProblemWe are required to write a JavaScript function which translates a given DNA string into RNA.ExampleFollowing is the code − Live Democonst DNA = 'GCAT'; const DNAtoRNA = (DNA) => { let res = ''; for(let ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
463 Views
ProblemWe are required to write a JavaScript function that takes in a number n. And our function should simply return the nth even number in natural numbers.ExampleFollowing is the code − Live Democonst num = 67765; const nthEven = (num = 1) => { const next = num * 2; const res = next - 2; return res; }; console.log(nthEven(num));Output135528
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
491 Views
ProblemWe are required to write a JavaScript function that takes in a string of digits. Our function should replace any digit below 5 with '0' and any digit 5 and above with '1' and return the resulting string.ExampleFollowing is the code − Live Democonst str = '262355677834342'; const convert = (str = '') => { let res = ''; for(let i = 0; i < str.length; i++){ const el = +str[i]; if(el < 5){ res += 0; }else{ res += 1; }; }; return res; }; console.log(convert(str));Output010011111100000
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
106 Views
ProblemWe are required to write a JavaScript function that takes in an array of objects that contains data about the continent of belonging for some people.Our function should return true if it finds six different continents in the array of objects, false otherwise.ExampleFollowing is the code − Live Democonst people = [ { firstName: 'Dinesh', lastName: 'A.', country: 'Algeria', continent: 'Africa', age: 25, language: 'JavaScript' }, { firstName: 'Ishan', lastName: 'M.', ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
857 Views
ProblemWe are required to write a JavaScript function that takes in an object that contains data about some people.Our function should simply find the average of the age property for those people.ExampleFollowing is the code − Live Democonst people = [ { fName: 'Ashish', age: 23 }, { fName: 'Ajay', age: 21 }, { fName: 'Arvind', age: 26 }, { fName: 'Mahesh', age: 28 }, { fName: 'Jay', age: 19 }, ]; const findAverageAge = (arr = []) => { const { sum, count } = arr.reduce((acc, val) => { let { sum, count } = acc; sum += val.age; count++; return { sum, count }; }, { sum: 0, count: 0 }); return (sum / (count || 1)); }; console.log(findAverageAge(people));Output23.4
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
641 Views
ProblemWe are required to write a JavaScript function that takes in an array that contains integers and string numbers.Our function should sum all the integers and string numbers together to derive a new number and return that number.ExampleFollowing is the code − Live Democonst arr = [67, 45, '34', '23', 4, 6, '6']; const mixedSum = (arr = []) => { let sum = 0; for(let i = 0; i < arr.length; i++){ const el = arr[i]; sum += +el; }; return sum; }; console.log(mixedSum(arr));Output185
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
919 Views
ProblemWe are required to write a JavaScript function that lives on the prototype object of Array.It must take in a literal value, and return true if that value is present in the array it is being called upon, false otherwise.ExampleFollowing is the code − Live Democonst arr = [1, 2, 3, 4, 5, 6, 7, 8]; const num = 6; Array.prototype.customIncludes = function(num){ for(let i = 0; i < this.length; i++){ const el = this[i]; if(num === el){ return true; }; }; return false; }; console.log(arr.customIncludes(num));Outputtrue
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
360 Views
ProblemWe are required to write a JavaScript function that takes in an array of numbers and a number. We should return true if all the numbers in the array are smaller than the number given as second argument, false otherwise.ExampleFollowing is the code − Live Democonst arr = [5, 34, 23, 14, 78, 45, 78]; const limit = 99; const checkEvery = (arr = [], limit = 1) => { const allSmaller = arr.every(el => { return el < limit; }); return allSmaller; }; console.log(checkEvery(arr, limit));Outputtrue
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
183 Views
ProblemWe are required to write a JavaScript function that takes in takes in an array of numbers. If in that array there exists any number which is the char code any vowel in ascii we should switch that number to the corresponding vowel and return the new array.ExampleFollowing is the code − Live Democonst arr = [5, 23, 67, 101, 56, 111]; const changeVowel = (arr = []) => { for (let i=0, l=arr.length; i