
How do we write humor in JavaScript?
When we combine emotional intelligence with logic this gives us space for banter.
Let’s look at the autonomy of an event and reflect it to a humorous joke.
When we make a purchase of an item, the transaction consists of a value exchanged for another value.
Apples for oranges or apples for money. both properties have a value associated with which facilitates and exchanges.
When conversing in human languages the block of exchanges are reflected in words of meaning, whereas that meaning in it’s self has a value associated to it, the value can mathematically be referred to as x= emotion 1 and y = emotion 2 in JS : (let x emotionX = 1 and let y emotionY = 2 ).
Now if x defines an emotion that automates a response then the value of x would be different to the emotional value of y.
how could this be formalised in javaScript or any other programming language.
The fundamentals of writing a javaScript program include:
binary operators for arithmetics such as (+, -, *, / and %) a string concatenation (+), comparisons (==, !=, ===, <, >, <=, >= ),
the logic (&&, || ) as-well as unary operators.
and to put into context using expressions and statements.
Now consider the Brexit joke I wrote in a previous article.
https://www.linkedin.com/pulse/paperless-economy-some-fun-javascript-agha-a-ali-sherazee/
What made the joke consist of a humorous not strictly logical value was that the mathematical value assigned to the joke had an emotional element referenced to a significant political event “Brexit”.
for example:
function checkDollar() {
let dollarBe = (dollarSubmit.value);
if (dollarCount === 3.67)
dollarSubmit.textContent = ‘Did you know that there is $1.54 trillion of U.S currency in circulation, and 97% percent of it is Federal Reserve Notes.’;
}
dollarSubmit.value = ‘’;
dollarSubmit.focus()
function checkEuro() {
let euroBe = (euroSubmit.value);
if (euroCount === 4.16)
euroSubmit.textContent = ‘Did you know, that currently, the euro is the only official currency of 16 EU member states’;
}
euroSubmit.value = ‘’;
euroSubmit.focus();
function checkPound() {
let poundBe = (poundSubmit.value);
if (poundCount != 4.16)
poundSubmit.textContent = ‘Did you know, Apart from the United Kingdom, several overseas territories of Britain also used the GBP (£). This included but not limited to Isle of Man, Jersey, and Bailiwicks of Guernsey.’;
}
The simple element of humor came into play when I leveraged basic javaScript math to set all values to true using the conversion rate of the designated currency to the rate of the UAE Dhiram, but with an exception on how I chose to define the value of the pound in relation to the Euro, whereas the pound is the currency of the UK and Euro being the currency of the EU.
By using the binary operator != (not equal) in relation to setting the value of the pound to the euro was an example of how current events can be referred to in basic mathematical terminology.
So therefore the joke essentially states that with the Brexit in motion the UK is not strictly equal to the EU.