[Question]
  [
My [boss](https://codegolf.stackexchange.com/questions/137209/efficient-robot-movement) now wants me to implement a mechanism that lets him search for an item in an array, and gives him the index/indices where that value occurs. 
## Your Task:
Write a program or function that receives an array and a value (String, Integer, Float, or Boolean), and returns the indices of the array at which the value occurs (either 0 or 1 indexed, whichever you prefer). If the value is not in the array return an empty array. 
## Input:
An array A and a value V, that may or may not be present in A. 
## Output:
An array containing the indice(s) at which the V occurs in A, or, if V does not occur in A, an empty array. 
## Test Cases:
Please note that the test cases are 0 based. 
```
12, [12,14,14,2,"Hello World!",3,12,12]         -> [0,6,7]
"Hello World", ["Hi", "Hi World!", 12,2,3,True] -> []
"a", ["A",True,False,"aa","a"]                  -> [4]
12, [12,"12",12]                                -> [0,2]
```
## Scoring:
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the lowest score in bytes wins. 
  
[Answer]
# [Pyth](http://pyth.readthedocs.io), 2 bytes
0-indexed.
```
xE
```
**[Try it online!](http://pyth.herokuapp.com/?code=xE&input=%22a%22%0A%5B%22A%22%2CTrue%2CFalse%2C%22aa%22%2C%22a%22%5D&test_suite=1&test_suite_input=%5B12%2C14%2C14%2C2%2C%22Hello+World%21%22%2C3%2C12%2C12%5D%0A12&debug=0&input_size=2)** or **[Check all the Test Cases](http://pyth.herokuapp.com/?code=xE&input=%22a%22%0A%5B%22A%22%2CTrue%2CFalse%2C%22aa%22%2C%22a%22%5D&test_suite=1&test_suite_input=%5B12%2C14%2C14%2C2%2C%22Hello+World%21%22%2C3%2C12%2C12%5D%0A12%0A%0A%5B%22Hi%22%2C+%22Hi+World%21%22%2C+12%2C2%2C3%2CTrue%5D%0A%22Hello+World%22%0A%0A%5B%22A%22%2CTrue%2CFalse%2C%22aa%22%2C%22a%22%5D%0A%22a%22%0A&debug=0&input_size=3)**
---
# Explanation
```
xEQ  - Full Program. Takes Input from standard input. Q means evaluated input and is implicit at the end of the program.
x   - Get all the indexes of x in y
 E  - Evaluated Input #2 - The value
  Q - The list - Evaluated Input #1
```
[Answer]
# JavaScript, 39 bytes
```
e=>a=>[...a.keys()].filter(i=>a[i]===e)
```
```
f=
e=>a=>[...a.keys()].filter(i=>a[i]===e)
console.log(f(12)([12,14,14,2,"Hello World!",3,12,12]));
console.log(f("Hello World")(["Hi", "Hi World!", 12,2,3,true]));
console.log(f("a")(["A",true,false,"aa","a"])); 
console.log(f(12)([12,14,14,2,"Hello World!",3,12,'12']));
```
The above snippet might not work on all browsers, so here's a [TIO link](https://tio.run/##FcnBCsIwDADQX9GdUqiBVm@Snf0DD6WHsqVSDYu0Q9jXdw7e7b3TL7Wplu96WXTmnqkzjYnGgIgJP7w1MBFzkZUrlH@FEomITZ90aSqMoi/I4LyB4Lx1t4O3w4NF9PTUKvN5sFd7nI/G3PsO).
[Answer]
# [MATL](https://github.com/lmendo/MATL), 2 bytes
```
mf
```
The `m` consumes two arguments, and checks each element in the array whether is equal to the other argument, `f` returns the indices of the truthy entries of an array.
[Try it online!](https://matl.suever.net/?code=mf&inputs=%7B%27Hi%27%2C+%27Hi+World%21%27%2C+12%2C+2%2C+3%2C+%27Hi+World%21%27%7D%0A%27Hi+World%21%27&version=20.2.2 "MATL – Try It Online")
[Answer]
# [Python 3](https://docs.python.org/3/), 45 bytes
*-3 bytes thanks to @EriktheOutgolfer and @Chris\_Rands*
```
lambda y,x:[i for i,j in enumerate(x)if j==y]
```
**[Test Suite.](https://tio.run/##VYtBCoMwEEX3PcU0qwRmY@yqkEU3xQMIXVgXKSY0EhNJFfT06Si0tDD8gf/@G9fpGUOZrbpnr4dHp2HF5dw4sDGBwx5cABPmwSQ9Gb4IZ6FXam3zmFyYuOWFRGgoitN2ElllvI9wi8l3R4Ylbky2Qhw@xu@CkcwqR4/yKwE5ktQ6zebP1Pv@wnaCV@1fBpmmlkgLIER@Aw "Python 3 – Try It Online")**
Today I learned `enumerate(x) == zip(range(len(x)),x)`.
---
# [Python 3](https://docs.python.org/3/), 47 bytes
```
lambda n,l:[x for x in range(len(l))if l[x]==n]
```
**[Try it online!](https://tio.run/##FcmxCoAgEIDhV7maFG7JmgL33qDBHIy0hOsMabCnt4Kfb/mv5z4S9zXopZI7180BI42mQEgZCkSG7Hj3gjwLkjIGIFOs1mzrlSPfIohOIZiPbvhT2E6eKMGcMm1Niz3@T1kp6ws "Python 3 – Try It Online")** or **[Check all the Test Cases](https://tio.run/##VYtBCsIwEEX3nmLMKoHZNHUldOFGeoCCi5pFpIkGxqTECvX0cVpQFIY/8N9/42u6pVgX35wL2ftlsBCR9v0MPmWYIUTINl6dJBclKRU8UD@bpommjDnESXpZaYSeo9otp1G0jijBKWUatgJrXJg2Sm0@xu9CsCzawI/zKwE7mtUuP92fadf9QawEj5YeDoXllokBUKq8AQ)**
[Answer]
# R (+pryr), 20 bytes
```
pryr::f(which(a==b))
```
Which evaluates to the function
```
function (a, b) 
which(a == b)
```
Where either `a` can be the value to look for and `b` the vector, or the other way around. When presented with two vectors of unequal lengths (a single value counts as a length-1 vector in R), R will wrap the shorter one to match the length of the longer one. Then the equality is checked. This generates a logical vector. `which` provides the indices where this vector is true.
[Try it online!](https://tio.run/##TYu7CsMwDEX3fIWqyQItcbt6yJCSIVMfdHbdmhhMDCGhn@9KLZSCuOI@zlKjq3Gbw5rKDMYz3Ama15TCZDw4J7ZG01qGoNoe9Czj8My5wK0s@bFD3rN2lgigiea/RAVxSPJFfwDI3gp2OV17ImX8d9nhJ@NjN557Ri@xVET1DQ "R – Try It Online")
[Answer]
# JavaScript (ES6), ~~44~~ 43 bytes
*Crossed out 44 is still regular 44 ;(*
```
v=>a=>a.map((x,i)=>x===v&&++i).filter(x=>x)
```
*Saved 1 bytes thanks to* [@Arnauld](https://codegolf.stackexchange.com/users/58563/arnauld)
```
let f=
v=>a=>a.map((x,i)=>x===v&&++i).filter(x=>x)
;
console.log(f(12)([12,14,14,2,"Hello World!",3,12,12]));         // => [1,7,8]
console.log(f("Hello World")(["Hi", "Hi World!", 12,2,3,true])); // => []
console.log(f("a")(["A",true,false,"aa","a"]));                  // => [5]
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 4 bytes
```
QāsÏ
```
[Try it online!](https://tio.run/##MzBNTDJM/f8/8Ehj8eH@//@jDY10FAxNIBjIVPJIzcnJVwjPL8pJUVTSUTAGyoBUGMVyGRoBAA "05AB1E – Try It Online")
1-indexed.
[Answer]
# C#, ~~88~~ 72 bytes
```
using System.Linq;a=>o=>a.Select((i,n)=>o.Equals(i)?n:-1).Where(n=>n>=0)
```
*Saved 16 bytes thanks to @LiefdeWen.*
[Try it online!](https://tio.run/##rZBNT8MwDIbv/RUmp0TqIlo4sbUITeNLIKHtsAPikHUeBKUOa1IQmvbbS9oKNgQ3sJTEid/keZ3CDUpLtiFVontRBcLs3Xks5Y2mdbSJIERhlHNw1@X9SRvOK68LeLV6CbdKExdfpZ2ojfOaipFdPGPh7x/i/W0MY2tMSLQlJy@QsNKFvJpQXWKlFgZHmnye57CCrFFZbrNcyRm2NzjXMYlwJCfrWhnHtTilk0Ei5PwJK@SU5ZRnh6IZRt/MjAPJGpTzSnsMPSJ3vtL0KK9taIEBi2HFCd/g0/AGkjSG5LgfIWWXaIyFua3M8iDIj@JekW4FT1IhxPBvQNgEhGYtSO8oLSLtYL6qEQJr3wf7H@wZ658PtfClYWFKtUYU64DqJ@ZX5hTVskPuibdRP2@bDw "C# (Mono) – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 3 bytes
```
⁼€T
```
[Try it online!](https://tio.run/##y0rNyan8//9R455HTWtC/v//H21opKNgaALBQKaSB1BFvkJ4flFOiqKSjoIxUAakwij2v6ERAA "Jelly – Try It Online")
-1 thanks to [Mr. Xcoder](https://codegolf.stackexchange.com/users/59487/mr-xcoder). (dyadic chains)
[Answer]
# [Haskell](https://www.haskell.org/), ~~41~~ 39 bytes
```
v!l=fst<$>(filter((==v).snd)$zip[1..]l)
```
[Try it online!](https://tio.run/##Xc7BaoQwEAbgc32K3@AhARHW9tgUKlTq2dIeFg8DyW5DU7ONqYfiu9uoFcpeZmDmn495p@FDWzvPY2rlaQj32QM/GRu051zKURRDr0T2Yy7HQ1F0VsyKAuFVtmiDN/15atD0YapRW0dhqlA5Z6G0N2Pc8qcvkXyS6SGhXHJziScBGXiDQynS49LyWO72UuZowZ7jRw5vzlvFcjS4zfdg2f1DrpLRWyaGbYbZxukqxGus@oKhwov/1lcU/QGPbA8svSY76BUk2mBiXQLMvw "Haskell – Try It Online")
*Saved two bytes thanks to @flawr*
Haskell is statically typed, so I had to use a little workaround to run the test cases.
[Answer]
# [Husk](https://github.com/barbuz/Husk), 5 bytes
```
`fNm=
```
[Try it online!](https://tio.run/##yygtzv7/PyHNL9f2////xv@jTXWMdYyA2FjHMBYA "Husk – Try It Online") 1-indexed.
### Explanation
```
       -- implicitly input a value v and a list L
   m=  -- map "equals v" over the list L, resulting in a list of truthy and falsy values
`fN    -- filter the natural numbers N by discarding the numbers at falsy positions 
          and keeping the ones at truthy positions
```
[Answer]
# Ruby, ~~46 40~~ 39 bytes
```
->e,a{i=-1;a.map{|x|i+=1;x==e&&i}-[!1]}
```
Saved 7 bytes!!! thanks to Eric Duminil.
[Try it online.](https://tio.run/##KypNqvyfZvtf1y5VJ7E601bX0DpRLzexoLqmoiZT29bQusLWNlVNLbNWN1pRsSC29n@BQlq0oZGOAogwNAEhIx0lj9ScnHyF8PyinBRFJR1jHZCcUWzsfwA)
[Answer]
# Ruby, 38 bytes
```
->e,a{a.each_index.select{|x|a[x]==e}}
```
[Try it online!](https://tio.run/##KypNqvyfZvtf165YJ7E6US81MTkjPjMvJbVCrzg1JzW5pLqmoiYxuiLW1ra4tvZ/gUJatKGRjgKIMDQBISMdJY/UnJx8hfD8opwURSUdYx2QnFFs7H8A "Ruby – Try It Online")
[Answer]
# Google Sheets, 101 bytes
```
=IfError(Join(",",Filter(Column(Offset(A1,0,0,1,Counta(Split(B1,",")))),Exact(Split(B1,","),A1))),"")
```
Value `V` in `A1` and array `A` in `B1` with each entry separated by a comma. Null entires are not allowed (row 5 below shows what happens).
[![Result](https://i.stack.imgur.com/fuURg.png)](https://i.stack.imgur.com/fuURg.png)
Explanation:
`Offset(A1,0,0,1,Counta(Split(B1,",")))` returns a range that is one row tall and as many columns wide as there are entries in `A1`.
`=IfError(Join(",",Filter(Column(~),Exact(Split(B1,","),A1))),"")` filters the column numbers of that range based on whether or not the value in `A1` is exactly each of the values in `B1` and concatenates them all in a comma-delineated list.
[Answer]
# [Clojure](https://clojure.org/), 40 bytes
First attempt at code golf.
`keep-indexed` maps a function over a collection here, passing the current index into the callback and yielding any non-nil return values.
```
(fn[a b](keep-indexed #(if(= %2 a)%1)b))
```
[Try it online!](https://tio.run/##FYvBCoMwEAV/5VURdiEesu219/5BDyEHbVZIuyQSLPTvrcLAHIZ5WX1/m@5kuiEcXkqYMEf6qK5jLkl/mtBTXuiOQTDx4Hlm3iNobblsVkAKLwhenL@diOsealbxrM3SpXNXdzaJfHx/ "Clojure – Try It Online")
[Answer]
# [APL (Dyalog Unicode)](https://www.dyalog.com/), 2 [bytes](https://codegolf.meta.stackexchange.com/a/9429/43319 "When can APL characters be counted as 1 byte each?")[SBCS](https://github.com/abrudz/SBCS ".dyalog files using a single byte character set")
Takes item to look for as left argument (must be scalar to find an *item* of the lookup array rather than a subarray) and the lookup array (which may have up to 15 dimensions) as right argument. Returns list of indices, each of which may has as many elements as the number of dimensions in the lookup array.
```
⍸⍷
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///qG@qp/@jtgkGCo965yqk5RcpGOgmJRanpiiUpBaXFP/PzANKPurd8ah3@///hkYKmXkKQC1ewf5@CurRhkY6hiYgZKSj5JGak5OvEJ5flJOiqKRjrAOSM4pV59J41NWkjiSprolqhpJHppKOApCE61UAajUCmlBSVJoKNUBHPRFDn6MSWIVOWmJOcaqOUmKiEpBQAmrA4kolQyMlsHMA "APL (Dyalog Unicode) – Try It Online")
`⍸` **ɩ**ndices where
`⍷` found
[Answer]
## Batch, 86 bytes
```
@set i=0
:g
@if "%~2"=="" exit/b
@if %1==%2 echo %i%
@set/ai+=1
@shift/2
@goto g
```
Takes input as command line parameters (value then the array elements as separate parameters). Note: String quoting is considered part of the match e.g. `"1"` won't equal `1` (would cost 6 bytes).
[Answer]
# [Python 2](https://docs.python.org/2/), 49 bytes
```
lambda l,v:filter(lambda i:l[i]==v,range(len(l)))
```
[Try it online!](https://tio.run/##K6gsycjPM/qfZhvzPycxNyklUSFHp8wqLTOnJLVIAyqSaZUTnRlra1umU5SYl56qkZOap5Gjqan5v6AoM69EIU0j2lBHwUhHwVhHwRCMjGKBlOZ/AA "Python 2 – Try It Online")
Not short enough, but I thought it was cool. ¯\\_(ツ)\_/¯
[Answer]
# [Perl 5](https://www.perl.org/), 28 bytes
```
sub{grep$_[$_]eq$_[0],1..@_}
```
[Try it online!](https://tio.run/##XYxRC4IwFIXf/RW3JViwJC0pkKJewh8Q9BAiE@8qWMw29yDRb1/TIEo4nAvn3PPVqERifQ4bsNqUz4vC2i/OfpHjw915TqMw3BUvm3pGI3BkjVEIgWZtkHrOgUsFPp9tJ1FMOy07xZRkKISEk1SiGhG66Lt4msIY9FUaUUGJEMEK1v@U3x2hQLLbx78kcKDY8Y7K4ACH97ppBzjWzfekf6cHJjRSwlzoisE6sW8 "Perl 5 – Try It Online")
The output is 1-indexed.  
An anonymous function is quite unusual for Perl, but it happens to be the shortest I could think of. `grep ..., 1 .. @_` iterates over the indexes of the input array (actually it goes one cell beyond the last, but it doesn't matter), keeping only the index that satisfy `$_[$_]eq$_[0]`, ie. the ones where the value of the element (`$_[$_]`) is the same as the value we need to keep (`$_[0]`).
---
Slightly longer (31 bytes (30 + `-l` flag)), but as a full program:
```
$@=<>;$@eq$_&&print$.-1while<>
```
[Try it online!](https://tio.run/##K0gtyjH9r6xYAKQVdHP@qzjY2thZqzikFqrEq6kVFGXmlajo6RqWZ2TmpNrY/f9vaMQFQiYgZMSl5JGak5OvEJ5flJOiqMRlzAWRBgA "Perl 5 – Try It Online")
[Answer]
# [Haskell](https://www.haskell.org/), ~~37~~ 33 bytes
```
import Data.List
findIndices.(==)
```
Thanks @Laikoni for -4 bytes!
[Try it online!](https://tio.run/##y0gszk7Nyfn/PzO3IL@oRMElsSRRzyezuIQrzTYtMy/FMy8lMzm1WE/D1lbzf25iZp6CrUJBUWZeiYKKQpqCkUK0kY6xjpGOCRCb6hjFcnH@BwA "Haskell – Try It Online")
[Answer]
# Java 8, ~~146~~ ~~113~~ ~~112~~ ~~111~~ ~~110~~ 108 bytes
```
import java.util.*;l->o->{List r=new Stack();for(int i;(i=l.indexOf(o))>-1;l.set(i,null))r.add(i);return r;}
```
-2 bytes thanks to *@TAsk* by using `Vector` instead of `ArrayList`.  
-1 byte by using `Stack` instead of `Vector`.  
0-indexed
**Explanation:**
[Try it here.](https://tio.run/##xVA9T8MwFNz7Kx6ebJS4SmFzG6kLYgAVqQMDYnATB5y6dmS/FKKqvz04UKBSGSsh@eN0d/K7cy23MnWNsnW57vWmcR6hjhxvURt@KQBgPIYHGWlXAb4qWHWo0sK1Fkcn/qq1BWpn@c0BiFFhZAhwL7XdjQACStQFfMvTufeyu9MBp4tVrQrMk1/ti0ngWM5zKGAGvUlzl@a7QQI/s@oNliiLNWWicp5qi6AF1TPDtS3V@6KijrE8zYThQSHViW2NYcxzWZZUM@EVtt6CF/texJRxNe3KxKCHvFunS9jEDnSJXtuXp2eQbOgDyy6g2nDXIm@igsbSgsumMR0dUp30o59M4DIMLM0mCWTXXztCcquMcfDovCkvSAJXURkcE8bY4dUBi3@Z/GMxJTlPBjKPk9C3KoFKmhAvIiUZTnI0VpLzNSbZhPz9n/vRvv8A)
```
import java.util.*;    // Required import for Vector and Vector
l->o->{                // Method with List and Object parameters
  List r=new Stack();  //  Result-list
  for(int i;(i=l.indexOf(o))>=-1;
                       //  Loop as long as we can find the object in the list
    l.set(i,null))     //   After every iteration, remove the found item from the list
      r.add(i);        //    Add the index to the result-list
                       //  End of loop (implicit / single-line body)
  return r;            //  Return the result-List
}                      // End of method
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 4 bytes
```
Qƶ0K
```
[Try it online!](https://tio.run/##MzBNTDJM/f8/8Ng2A@///6MNdYx0jHVMdEyB2BjIhvNjuYwB "05AB1E – Try It Online")
**It is 1-indexed, as shown below:**
```
IN A-#------------------------> [2,3,3,3,4]
IN B-#------------------------> 3
-----#------------------------+-----------------
Q    # Vectorized equivalence | [0,1,1,1,0]
 ƶ   # Lift by index          | [0,2,3,4,0]
  0K # Remove zeros           | [2,3,4]
```
[Answer]
# Mathematica, 12 bytes
```
Position@##&
```
1-Indexed
**input** [Array,Value]
> 
> [{12, 14, 14, 2, "Hello World!", 3, 12, 12}, 12]
> 
> 
> 
**output**
> 
> {{1}, {7}, {8}}
> 
> 
> 
[Answer]
## Haskell, 29 bytes
```
e#l=[i|(i,h)<-zip[0..]l,h==e]    
```
[Try it online!](https://tio.run/##y0gszk7Nyfn/P1U5xzY6s0YjUydD00a3KrMg2kBPLzZHJ8PWNjX2f25iZp6CrUJBUWZeiYKKgqGRgrJCtIGOoY6hkY6xjgmIMtMxB1GWsf8B "Haskell – Try It Online")
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 9 bytes
```
mÈ¶V©YÄÃf
```
1-indexed.
Japt input doesn't support booleans, so they have been replaced with `0` and `1` in the test cases.
[Try it online!](https://codepen.io/justinm53/full/NvKjZr?code=bci2VqlZxMNm&inputs=WzEyLDE0LDE0LDIsIkhlbGxvIFdvcmxkISIsMywxMiwxMl0KMTI=,WyJIaSIsIkhpIFdvcmxkISIsMTIsMiwzLHRydWVdCiJIZWxsbyBXb3JsZCI=,WyJBIiwgMSwgMCwgImFhIiwgImEiXQoiYSI=,WzEyLCIxMiIsMTJdCjEy&flags=LVE=) with the `-Q` flag to format the array output.
## 0-indexed Solution, 11 bytes
```
l o f@gX ¶V
```
[Try it online!](https://codepen.io/justinm53/full/NvKjZr?code=bCBvIGZAZ1ggtlY=&inputs=WzEyLDE0LDE0LDIsIkhlbGxvIFdvcmxkISIsMywxMiwxMl0KMTI=,WyJIaSIsIkhpIFdvcmxkISIsMTIsMiwzLHRydWVdCiJIZWxsbyBXb3JsZCI=,WyJBIiwgMSwgMCwgImFhIiwgImEiXQoiYSI=,WzEyLCIxMiIsMTJdCjEy&flags=LVE=)
[Answer]
# [Perl 6](http://perl6.org/), 21 bytes
```
{grep :k,*===$^v,@^z}
```
[Try it online!](https://tio.run/##K0gtyjH7n1upoJamYPu/Or0otUDBKltHy9bWViWuTMchrqr2v7VCcWKlQpqGoZGOAphQMjRS0lEwNNLUtP4PAA "Perl 6 – Try It Online")
The `:k` adverb to `grep` tells it to return the matching keys (indices) of the input sequence that match the predicate `* === $^v`.
If strings and numbers were considered equivalent, one could use a grep predicate of just `$^v` instead of `* === $^v`.
[Answer]
# Common Lisp, 66 bytes
```
(lambda(x s)(loop as i in s as j from 0 when(equal i x)collect j))
```
[Try it online!](https://tio.run/##TU/RagIxEHyuXzEulO6CQi/1udA3/8CHUiG9O2lk76KXE4XS/LpuTloaNmwmM5PN1BrS4coa4wG7OIAvSILQ44m5cii7WpVyoHWrGrGJgzZzwgsK50T4P0EwGMjE4U9pOmfyUWT2YIvJF9UbYUQfFOQN250IfkdS5Wh6uzjQRLD9rfOjOSinBd7zd055u8g/H1i@TtDfYX4kWASwZfLdZ@OnQPd8PiGUaKmc9tgNscMzzl9tz@3x5NXYi9RRta1H7EWuxWrtBg)
[Answer]
## [TXR Lisp](http://nongnu.org/txr), 26 bytes
```
(op where(op equal @@1)@2)
```
In other words, "Where is argument 2 equal to argument 1?"
Run:
```
1> (op where(op equal @@1) @2)
#<interpreted fun: lambda (#:arg-01-0166 #:arg-02-0167 . #:rest-0165)>
2> [*1 12 #(12 14 14 2 "Hello world!" 3 12 12)]
(0 6 7)
3> [*1 "Hello World" #("Hi" "Hi world!" 12 2 3 t)]
nil
```
[Answer]
## Clojure, ~~39~~ 38 bytes
```
#(filter(comp #{%2}%)(range(count %)))
```
A bit obscure :) The first input argument is a `vec` of values and the second one is the searched value. `%` maps indexes to values, and the set `#{%2}` returns truthy (the input argument `%2`) or falsy `nil` for that value. [comp](https://clojuredocs.org/clojure.core/comp) composes these together.
[Answer]
## C ~~340~~ ~~362~~ ~~166~~ 115 Bytes
Hello all. My first time here. I figured since I enjoy (attempting) to write optimized code I may as well give this a try.
@Rodney - ~39 bytes from the includes
@Zacharý - 7 bytes with implicit typing
**0-indexed**.
**How to Run:**
As per @Arnolds suggestion, the program takes arguments in a much more C friendly manner. This let me reduce the size of the file by a little more than half.
The arguments should be passed in the following order `value [element1 ...]`
where braces indicate optional arguments
You may or may not have to add escaped quotes to any strings that are provided in order to satisfy the condition of `12 != "12"`. On my system the this can be done in the following manner
```
prog-name.exe 12 3 "Hello" 12 4 "12"
Returns [2,4]     < This is incorrect
prog-name.exe 12 3 "\"Hello\"" 12 4 "\"12\""
Returns [2]       < Correct
```
---
golfed
```
#define P printf(
b=0;main(int c,char**v){P"[");for(--c;c-1;c--)b|=strcmp(v[1],v[c])?0:P b?",%i":"%i",c-2);P"]");}
```
ungolfed
```
#define P printf(
//Implicit only works in global(I totally knew this after almost 4 years of C :P)
b = 0;
main(int c,char**v)
{
    P"[");
    //match loop
    //b is used to determine if this is the first iteration. it can be assumed that printf will always return >0
    //subract two from c to get correct index number of match
    for(--c; c-1; c--)
        b |= strcmp(v[1], v[c]) ? 0 : P b ? ",%i" : "%i", c-2);
    P"]");
    return 0;
}
```
]