I'm taking a web programming course this semester and I'm new to JS. we have a homework assignment to implement certain functions with a heavy set of restrictions. we cannot use any sort of assignment operation, or classic iteration and recursion. the result has to be evaluated within a single line of a return statement.
the question:
when given a non-negative integer int, returns the list of indexes at which the binary representation of int has a 1. You should assume that the bits in a binary representation are indexed starting at the LSB; i.e. LSB corresponds to index 0 and the MSB corresponds to index 30
this is what I have so far:
function intToBitIndexes(number) {
re