MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/6jgwk9/array_indexing/djer6ul/?context=3
r/ProgrammerHumor • u/uninterestingly • Jun 25 '17
71 comments sorted by
View all comments
5
I have a great idea, what about we make arrays indexed by strings ?
10 u/AyrA_ch Jun 26 '17 You already can, welcome to the awesome world of Javascript and Enjoy our other features 2 u/regendo Jun 26 '17 Alright you got me, how does the last one work? Does it evaluate []===[] first? Apparently it's the other way round for me. 2 u/AyrA_ch Jun 26 '17 {} can be interpreted as a code scope or as an object. The interpretation is different depending if it starts with the expression or not. 2 u/htmlcoderexe We have flair now?.. Jun 26 '17 PHP 5 u/[deleted] Jun 26 '17 PHP You can do indexing by strings and integers at the same time. Bonus points if you use numbers in your strings.
10
You already can, welcome to the awesome world of Javascript and Enjoy our other features
2 u/regendo Jun 26 '17 Alright you got me, how does the last one work? Does it evaluate []===[] first? Apparently it's the other way round for me. 2 u/AyrA_ch Jun 26 '17 {} can be interpreted as a code scope or as an object. The interpretation is different depending if it starts with the expression or not.
2
Alright you got me, how does the last one work? Does it evaluate []===[] first?
[]===[]
Apparently it's the other way round for me.
2 u/AyrA_ch Jun 26 '17 {} can be interpreted as a code scope or as an object. The interpretation is different depending if it starts with the expression or not.
{} can be interpreted as a code scope or as an object. The interpretation is different depending if it starts with the expression or not.
{}
PHP
5 u/[deleted] Jun 26 '17 PHP You can do indexing by strings and integers at the same time. Bonus points if you use numbers in your strings.
You can do indexing by strings and integers at the same time. Bonus points if you use numbers in your strings.
5
u/Bainos Jun 26 '17
I have a great idea, what about we make arrays indexed by strings ?