Hmhm #1

Open
opened 5 years ago by 1nt3rn3t · 0 comments

Disclaimer: I'm relatively new to JavaScript

Hello,

I have just read your amazing post about jwt and somehow I found this.

So if you don't mind answering, isn't your lib the exact same thing as:

let stringValue = "two";

let someObject = {
    someBoolean: true,
    someString: "This is a dummy object",
    someNumber: (() => {
        if (stringValue === "one") {
            return 1;
        } else if (stringValue === "two") {
            return 2;
        } else if (stringValue === "three") {
            return 3;
        }
    })()
};

What am I missing?

Thanks.

Disclaimer: I'm relatively new to JavaScript Hello, I have just read your [amazing post about jwt](http://cryto.net/~joepie91/blog/2016/06/13/stop-using-jwt-for-sessions/) and somehow I found this. So if you don't mind answering, isn't your lib the exact same thing as: ```js let stringValue = "two"; let someObject = { someBoolean: true, someString: "This is a dummy object", someNumber: (() => { if (stringValue === "one") { return 1; } else if (stringValue === "two") { return 2; } else if (stringValue === "three") { return 3; } })() }; ``` What am I missing? Thanks.
Sign in to join this conversation.
No Label
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: joepie91/as-expression#1
Loading…
There is no content yet.