Странные особенности языков программирование
От: _Oleg_ Украина  
Дата: 13.08.10 19:59
Оценка: 8 (3)
Обсуждение на StackOverflow

Некоторые...

JavaScript:

'5' + 3 gives '53'
'5' — 3 gives 2


JavaScript:

return
{
id : 1234,
title : 'Tony the Pony'
};
is a syntax error due to the sneaky implicit semicolon insertion on the newline after return.

The following works as you would expect though:
return {
id : 1234,
title : 'Tony the Pony'
};


Java:
Integer foo = 1000;
Integer bar = 1000;

foo <= bar; // true
foo >= bar; // true
foo == bar; // false

//However, if the values of foo and bar are between 127 and -128 (inclusive)
//the behaviour changes:

Integer foo = 42;
Integer bar = 42;

foo <= bar; // true
foo >= bar; // true
foo == bar; // true



Нашел здесь


14.08.10 21:51: Перенесено из 'О работе'
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.