خرید بک لینک

Vote count: 0

I made code that will check is that the first letter is uppercase. There's one error, it says.

Uncaught SyntaxError: Unexpected token

This code Works in other languages like PAWN and C++/C. Why it doesn't work in jQuery?

switch(_ime[0])
{
    case 'A' .. 'Z': { }
    default: retu -2;
}

asked 5 mins ago

1 Answer

Vote count: 2

.. is not valid syntax in Javascript. If you want to do this you would need to include each case manually:

switch(_ime[0]) {
    case 'A':
    case 'B':
    // and every other letter...
    case 'Z':
        console.log('A to Z');
    default: 
        retu -2;
}

answered 2 mins ago

برچسب: نویسنده: استخدام کار تاريخ: چهارشنبه 8 ارديبهشت 1395 ساعت: 19:54

صفحه بندی