<p dir="auto"><strong>Today's Java Script learning session was about completing my first small project.
<p dir="auto">Here's is the main function of my website.
<p dir="auto">In order to calculate your age in days, do the following:
<pre><code>Java Script:
function ageInDays () {
var actualYear = prompt('What is the actual year?');
var birthYear = prompt('What year were you born?');
var remainderYears = (actualYear - birthYear);
var normalDays = (remainderYears * 365);
var additionalDays = (Math.floor(remainderYears / 4));
var totalDays = (normalDays + additionalDays);
var h1 = document.createElement('h1');
var textAnswer = document.createTextNode('You are ' + totalDays + ' days old');
h1.setAttribute('id', 'ageInDays');
h1.appendChild(textAnswer);
document.getElementById('flex-box-result').appendChild(h1);
<p dir="auto">And in order to call this function:
<pre><code>HTML:
<body>
<div class = "container-1">
<h2>Challenge 1: Your age in days</h2>
<div class = "flex-box-container-1">
<div>
<button class = "btn btn-primary" onclick="ageInDays()">Click me</button>
</div>
<div>
<button class = "btn btn-danger" onclick="reset()">Reset</button>
</div>
</div>
<div class = "flex-box-container-1">
<div id = "flex-box-result"></div>
</div>
</div>
<p dir="auto">I'll upload the second challenge tomorrow.
<p dir="auto">It's a cat generator!
<p dir="auto">Dam, I really know how to spend my time.
<h2>Closing thoughts
<ul>
<li>I know I should be using 'let' or 'const' instead of 'var' but I wasn't able to call my function while clicking the "ageInDays()" button. What changes would you recommend me doing?
<h3>Crypto Stuff
<div class="table-responsive"><table>
<thead>
<tr><th>Browsers<th>Exchanges<th>Wallets
<tbody>
<tr><td><a href="https://brave.com/fpd873" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Brave<td><a href="https://www.coinbase.com/join/casano_uw" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Coinbase<td><a href="https://atomicwallet.io/join?kid=19F265" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Atomic
<tr><td><td><a href="https://changelly.com/?ref_id=ozkrq2f6icr6lb3c" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Changelly<td><a href="http://lddy.no/mi1m" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">KeepKey
<tr><td><td><a href="https://localbitcoins.com/?ch=1agvu" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">LocalBitcoins<td><a href="https://trezor.io/?offer_id=12&aff_id=3506" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Trezor
<tr><td><td><a href="https://www.xcoins.com/2020/r.php?id=511" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Xcoins<td><a href="https://shop.ledger.com/pages/ledger-nano-x?r=a6ad91912b2b" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Ledger
<tr><td><td><a href="https://exmo.com/?ref=1783981" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Exmo<td>
<tr><td><td><a href="https://paxful.com/?r=xgQPK6Vz5kp" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Paxful<td>
<tr><td><td><a href="https://poloniex.com/signup?c=EE965NX5" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Poloniex<td>
<tr><td><td><a href="https://www.bitmex.com/register/A0Elvb" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">BitMEX<td>
<tr><td><td><a href="https://www.coinigy.com/?r=a7548ae8" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Coinigy<td>
<tr><td><td><a href="https://bittrex.com/Account/Register?referralCode=1LY-4DQ-3EA" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Bittrex<td>