last day (15 days later) » 

09:04
0
A: Javascript show specific array data from global array data with another case

SwatiYou can use statusTranslate == "Y" ? objSportIDLanguange[i] : objSport[i] this will return objSportIDLanguange value if Y else other value then pass this to your div . Demo Code : var wantToShow = ['Football', 'Rugby', 'Tennis', 'Badminton', 'Fishing']; //without hiking var objSport = ['Footb...

Hi, 1 question how about if I set like this var objSportIDLanguange = ['Sepakbola', 'Ragbi', 'Tenis', 'Bulu Tangkis', 'Memancing']; without Mendaki. I mean only value var wantToShow will be translate. Not in global array objSport
Please have a look on this fiddle: jsfiddle.net/c2kgofp1
Hi, wantToShow will be in english only ? because objSportIDLanguange is in another language they will not match
Hi wantToShow can be English or Indonesia. The point is only translate with requirement if (wantToShow.indexOf(objSport[i]) > -1)
so if statusTranslate is y then wantToShow will be another language and if n then wantToShow will be in english ? am i right ?
Yes, like that what I mean
09:04
I am still not sure if i understood or not what you are trying to say. But , check this fiddle .
hello :)
Thanks for your attend here
I tried to set var statusTranslate = "Y";
I can see on the log ["Sepakbola", "Ragbi", "Tenis", "Bulu Tangkis", "Memancing"]
But why not show on result?
because .. wantToShow is in english
so if (wantToShow.indexOf(value[i]) > -1) { this is never true
Can we just show to result like console log result ?
["Sepakbola", "Ragbi", "Tenis", "Bulu Tangkis", "Memancing"]
So I think We will not use this if (wantToShow.indexOf(value[i]) > -1) anymore maybe?
09:09
yes remove that
OK got it.
Thanks btw for your help
:) your welcome
Happy coding
Take care ,,,cya on another post :)

last day (15 days later) »