-
Write a JavaScript program to display the current day and time in the following format
Sample Output : Today is : Tuesday. Current time is : 10 PM : 30 : 38
-
Write a JavaScript program to find the area of a triangle where lengths of the three of its sides are 5, 6, 7.
-
Write a JavaScript program to determine whether a given year is a leap year in the Gregorian calendar.
-
Write a JavaScript program to compute the sum of the two given integers, If the sum is in the range 50..80 return 65 other wise return 80.
-
Write a JavaScript program to count the number of vowels in a given string.
-
Write a simple JavaScript program to join all elements of the following array into a string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function formatToDollar (number) { | |
| return new Intl.NumberFormat('en-US', { | |
| style: 'currency', | |
| currency: 'USD', | |
| }).format(number) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!-- | |
| This file is based on the javascript.lang file of GtkSourceView. | |
| It has additional Typescript keywords defined. | |
| Author: Johannes Bergmann | |
| Copyright (C) 2014 Johannes Bergmann | |
| ### | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const multer = require('multer'); | |
| const storage = multer.diskStorage({ | |
| destination: function (req, file, cb) { | |
| cb(null, './uploads/') | |
| }, | |
| filename: function (req, file, cb) { | |
| cb(null, new Date().toISOString() + '-' + file.originalname) | |
| } | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ES6 w/ Promises | |
| // Note: From a React starter template - see https://t.co/wkStq8y3I5 | |
| function fetchData(routes, params) { | |
| let data = {}; | |
| return Promise.all(routes | |
| .filter(route => route.handler.fetchData) | |
| .map(route => { | |
| return route.handler.fetchData(params).then(resp => { | |
| data[route.name] = resp; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| require 'db_config.php'; | |
| /** | |
| * <?php | |
| * $servername = "127.0.0.1"; | |
| * $username = "root"; | |
| * $password = ""; | |
| * $dbname = "myDB"; | |
| * ?> |
NewerOlder