Review my very first JS problem – Absolute Begginer

  algorithm, javascript

¡Hello!

I’ve just joined the blog. I started learning JS last week and I’m thinking about this problem:
I need to know the value of the x variable after the function f has been executed.

This is the code:

function f(a, b, c, d){
    b = 4.0;
    c = 'A';
    return !(d || (a > 4) && (b < 3.5));
}

var d, c, a, x;

a = true;
c = 7.0;
d = 5;
x = f(d,c,'R',a);

I think that, at the end, x might be false (?)

I know that this looks completely silly compared to many coding issues down there but I’m still starting to crawl. Thanks 🙂

Source: Ask Javascript Questions

LEAVE A COMMENT