I think mine would be json_encode()
. I think it's so cool that a single function can make your data understood by other machines. (I know other machines can interpret different kinds of data, but c'mon...)
How about you? What's your favourite function?
Oldest comments (36)
😉
Reference
Based on usage it's probably
console.log()
orvar_dump()
.At the moment I'm enjoying some JavaScript array methods -
filter
,map
,reduce
.var_dump (); die ()!!!
I usually do like:
die(var_dump());
I stopped doing this simply because I can't do it if I dump multiple variables at once.
But you could do
die(var_dump($res, $res2));
, couldn't you?You can
Really? Wow, #TIL!
Yeah, just like
console.log(var1, var2)
in JStypeof(arg);
surprisingly useful
random()
functions, there is so much more behind them then we usually think. I can talk hours about entropy and sources, techniques, pseudo algorithms and how can it improve almost any software product.Improve in what way?
In the way of randomized algorithms
As in, some product features can be improved using random (shuffle or generate things), most basic example is chose new 5 news headlines to see from the top 100 articles to an user, each x seconds/page views.
inb4
p e r s o n a l i z a t i o n
🤣
Because it took me almost half a year to realize that it's a function, not a language construct.
Arrow function 🤓.
this
has never been easier.mine is fmap ...
fmap :: (a -> b) -> F a -> F b
with F being a Functor :-)
I find this one, truly comforting for some reason.
I like map.put and map.get. Maps/Dictionaries are incredibly useful data structures that we tend to take for granted nowadays.
Don't know if it's only a function, but ajax in Javascript is something else: the whole idea of a function connecting asynchronously to a server and retrieving data without the need of recharge the entire page is amazing.