using arrow functions to convert small functions into one line statement functions

in this exercise i will take a function variable and write it in one line using the arrow function

JS

// here is the full function
const the_date = function() {
  "use strict";
  return new Date();
};
console.log(the_date);

// here it is written with an arrow function
"use strict";
const the_date_2 = () => new Date();
console.log(the_date_2);

HTML

<div id='result' class='mb-3 alert alert-primary'>..</div>
<button onclick='run_function();' class='btn btn-primary mb-1'>Run Function</button>

Other Items in javascript
Page Views

This page has been viewed 434 times.

Search Code
Search Code by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code snippits here, mostly for my reference. Also if i find a good site, i usually add it here.

❤👩‍💻🕹

Random Quote
therock Somewhere along this crazy road I learned (often times the hard way) the most important things I can do is be authentic, trust my gut, be the hardest worker in the room, celebrate the mistakes, be a grateful man and always remember that it's nice to be important, but it's more important to be nice.
The Rock