So i understand that this is like incomplete at best… likely less than efficient… possibly just not even gonna work… maybe even something yall might just giggle at when you see it… but im wondering if im heading in the right direction even… with any part of this even…any hints or suggestions…
or should i and digitally dowse this whole attempt in some digital lighter fluid & code in a zippo… burn it downn???
help? Your code so far
const isNum = function(num){
return(Number.isInteger(num))
}
function addTogether() {
let values = Object.values(arguments)
let primaryVal = values[0]
let result = 0
let priorPlus = function(numb){
result = primaryVal + numb
return result
}
// has to add two numbers passed as parameters and
// return the sum
if(values.length === 2 && Number.isInteger(values[0]) !== true && Number.isInteger(values[1]) === true){
result = values[0] + values[1]
return result
}
// check if any of the numbers are actual numbers, //otherwise return undefined
if(values.length <= 2 && (Number.isInteger(values[0]) !== true || Number.isInteger(values[1])) !== true){
return undefined
}
//if only 1 argument return a function that uses that number and expects
//another one, to then add it.
if (values.length < 2 && Number.isInteger(primaryVal)){
return priorPlus()
}
}
console.log(addTogether(2,3))
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36
So after poating that i went to town with whatever this is… now my question comes with an analogy to context…
pretend im a highway engineer and ive built 60% of this hon ramp off ramp thingy but it has to follow zone laws x, y z and has to connect at a very specific point, two different specific points to weight the context,
whats been built has to connect to where ever specific
while following the zoning parameters…
there is NO budget for any kind of ENTIRE demolition and redesign
this is my feels right now… im so close to being able to teachmyself HOW to “javascript”…
how do i connect my OWN overpass design to
what i need to
how i need to do it
what do i need to do to finish this build
preferably the lightest sprinkle of a hint please
const isNum = function(num){
return(Number.isInteger(num))
}
function addTogether() {
let values = Object.values(arguments)
let primaryVal = values[0]
let result = 0
let priorPlus = function(numb){
result = primaryVal + numb
return result
}
// has to add two numbers passed as parameters and
// return the sum
if(values.length === 2 && Number.isInteger(values[0]) !== true && Number.isInteger(values[1]) === true){
result = values[0] + values[1]
return result
}
// check if any of the numbers are actual numbers, //otherwise return undefined
if(values.length <= 2 && (Number.isInteger(values[0]) !== true || Number.isInteger(values[1])) !== true){
return undefined
}
//if only 1 argument return a function that uses that number and expects
//another one, to then add it.
if (values.length < 2 && Number.isInteger(primaryVal)){
return priorPlus()
}
}
console.log(addTogether(2,3))
are you asking while already knowing
or genuinly
no cinicism… just wondering cuz i thought there were no decimals it was either data type = number or else === false
are you refering to the type difference between
ex: 6 && “6” && 6 && [6] && {“1”:6} &&{[6]}
or …
cuz currently in context
my brain thinkings are prefaced with
4 , (and i guess 1.2) should are
data_types === Number === true
“4” {“1”:6} {[6]}
are …
data_types === Number === false
const isNum = function(num){
return(Number.isNaN(num) !== true)
}
function addTogether() {
let values = Object.values(arguments)
if(Number.isNaN(values[0])){
return undefined
}
let primaryVal = values[0]
let otherVal = values[1]
let result = 0
let priorPlus = function(numb){
result = primaryVal + numb
console.log(numb)
return result
}
// has to add two numbers passed as parameters and
// return the sum
if(values.length === 2 && Number.isNaN(values[0]) !== true && Number.isNaN(values[1]) !== true){
result = values[0] + values[1]
return result
}
// check if any of the numbers are actual numbers, //otherwise return undefined
if(values.length <= 2 && (Number.isNaN(values[0]) === true || Number.isNaN(values[1])) === true){
return undefined
}
//if only 1 argument return a function that uses that number and expects
//another one, to then add it.
if (values.length < 2 && Number.isNaN(primaryVal) !== true && Number.isNaN(otherVal)){
return priorPlus(otherVal)
}
}
console.log(addTogether(2,3))
console.log(addTogether(5))
@JeremyLT
im still working this original build. and i just saw this bit … am working in replit on making it functional… if i got any more Q’s to ask… can i drop em in your DM?
or is here still the appropriate means to communicate?
(I only ask as i did “solve it” in curriculum)
@a4addel Happy Coding My Dood
also appreciate anybody taking the time and lending a fresh pair of eyes …
…
and there brain to help…