Closed rajivramv closed 7 years ago
We've had this discussion in the past, but I use benchmarks to determine what format to use.
fwiw, I've had other variations of kind-of using switch
statements in the benchmarks, and there were situations where it was minutely faster, but as the code is currently switch
statements were a tiny bit slower.
I don't have an emotional attachment to if/else statements, switch statements, or any other kind of code, I just use whatever appears to be the most performant, and I usually re-run the benchmarks and try new configurations with each new node.js release.
Consider replacing the if-else lines below this to switch case? https://github.com/jonschlinkert/kind-of/blob/72d2f2bfcd3c0f3306305cde147facf63a3c0e7e/index.js#L52