Looking for a way to optimize my code, I have seen that there are three ways to create asynchronous tasks:
- call back
- Promise Chaining
- async/await
What are the differences between callbacks, promises and async/await?
Looking for a way to optimize my code, I have seen that there are three ways to create asynchronous tasks:
What are the differences between callbacks, promises and async/await?
I have a doubt about the existence of the famous NaN , I would like to know, what is it for? What is your "existential meaning"?
So far the only thing I have been able to understand based on things I have seen in books and videos is that in summary it would be a kind of Error indicator in mathematical operations that usually warns us that there is an "invalidity" (such as multiplying a string for an integer); In addition, its data type is numeric and its value is undefined and different from any other value.
I am right? is it used for something else?
I add a couple of quotes:
NaN means "Not a Number". When a function or mathematical operation in JavaScript cannot return a specific number, it returns the value NaN instead. It is a property of the global object, and a reference to Number.NaN
JavaScriptNotes for Professionals - GoalKicker.com - Pg. 13.
It is a special static numeric property, NaN, which is equivalent to the global NaN, and is equivalent to Not-a-Number. Anytime you try to use a value in a numeric operation that can't be parsed as a number, you'll get a NaN error.
Javascript Cookbook, Shelley Powers - Pg. 56
NaN is short for Not-a-Number and represents an illegal number. It uses the isNaN() function to determine if a number is legal or valid according to the ECMA-262 specification.
JavaScript Step by Step 2ed. Steve Suehring - Pg. 63
The context of the question would be only in terms of its application in JavaScript, since talking about programming in general, arithmetic, computing or other topics would make the question much broader and it would become a bit ambiguous; on the other hand, I understand that the existence of an "Error", "message" or "alert" may be logical for a situation such as the one that can arise when operating irrational numbers or taking mathematical operations out of the mathematical "context", but , how can NaN differ from "typical" Error messages?
I had to make a web application and based on certain business rules send SMS
them to clients notifying them of their movements, at that time when investigating I found several pages with apis
or services where you make a call sending them certain information and they send the SMS
, and charge you for SMS
.
So I started to think how I could do that service myself, thinking of paying for a plan with SMS
unlimited
I want to know how to make a JavaScript function that returns the coordinates at a given minute . The central coordinates are the center of the clock, so they can be negative.
In Microsiervos I found a link , which parallels what I'm asking, it's a clock that gives you the time in coordinates .
I'm trying division or subtraction, but it doesn't work.
function(minutos)
{
var x=0,y=0
x=minutos*60
y=x-12
return [x,y]
}
edit:
Looking at some answers I have seen something strange: Why use cosine , if it is possible to extract in value using sine ?