Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #38575 > unrolled thread
| Started by | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| First post | 2020-07-21 14:26 -0700 |
| Last post | 2020-07-21 15:16 -0700 |
| Articles | 5 — 2 participants |
Back to article view | Back to comp.lang.javascript
Object property not inserted or reached. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-07-21 14:26 -0700
Re: Object property not inserted or reached. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-07-21 23:34 +0200
Re: Object property not inserted or reached. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-07-21 14:47 -0700
Re: Object property not inserted or reached. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-07-22 00:38 +0200
Re: Object property not inserted or reached. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-07-21 15:16 -0700
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2020-07-21 14:26 -0700 |
| Subject | Object property not inserted or reached. |
| Message-ID | <e0d2ae34-f1bb-4971-b65f-d367c9de4b68o@googlegroups.com> |
Running this code it seem i have not inserted anything into object array, or i fail to retrieve it?
let tileElement=[];
function chessObject(m) {
tileElement[m] = {
tileColor : "",
tileName : "",
occupied : false,
pieceColor: "",
pieceType: "",
};
return tileElement;
}
for (var m =0; m < 1; m++) {
chessObject(m);
}
initTiles();
function initTiles(){
tileElement.push({tileColor:"W",tileName:"A1", occupied:true,pieceColor:"W",pieceType:"R"});
alert(tileElement[0].tileColor);
}
[toc] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2020-07-21 23:34 +0200 |
| Message-ID | <XnsAC01EFCB4B271eejj99@194.109.6.166> |
| In reply to | #38575 |
<jonas.thornvall@gmail.com> wrote on 21 Jul 2020 in comp.lang.javascript:
> for (var m =0; m < 1; m++) {
How many times does this run?
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2020-07-21 14:47 -0700 |
| Message-ID | <d250468b-64a3-4de6-a661-b6399e4024deo@googlegroups.com> |
| In reply to | #38576 |
Den tisdag 21 juli 2020 kl. 23:34:27 UTC+2 skrev Evertjan.:
> <jonas.thornvall@gmail.com> wrote on 21 Jul 2020 in comp.lang.javascript:
>
> > for (var m =0; m < 1; m++) {
>
> How many times does this run?
>
>
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)
Ok set to two just an example
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2020-07-22 00:38 +0200 |
| Message-ID | <XnsAC0268D9B761eejj99@194.109.6.166> |
| In reply to | #38577 |
<jonas.thornvall@gmail.com> wrote on 21 Jul 2020 in comp.lang.javascript:
> Den tisdag 21 juli 2020 kl. 23:34:27 UTC+2 skrev Evertjan.:
>> <jonas.thornvall@gmail.com> wrote on 21 Jul 2020 in comp.lang.javascript:
>>
>> > for (var m =0; m < 1; m++) {
>>
>> How many times does this run?
>
> Ok set to two just an example
No, that is NOT ok.
you should say:
"Sorry, I was sloppy in my question"
If you want our help,
you should be decent enough to debug it before you post it:
for (var m =0; m < 1; m++) {
console.log(m);
.....;
};
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2020-07-21 15:16 -0700 |
| Message-ID | <3daedb4b-e2d7-4ed7-834a-6995f1bcb246o@googlegroups.com> |
| In reply to | #38576 |
Den tisdag 21 juli 2020 kl. 23:34:27 UTC+2 skrev Evertjan.:
> <jonas.thornvall@gmail.com> wrote on 21 Jul 2020 in comp.lang.javascript:
>
> > for (var m =0; m < 1; m++) {
>
> How many times does this run?
>
>
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)
<script>
let tileElement=[];
//tileElement[] = {
// tileColor : "",
// tileName : "",
// occupied : false,
// pieceColor: "",
// pieceType: "",
//};
initTiles();
function initTiles(){
tileElement.push({tileColor:"W",tileName:"A1", occupied:true,pieceColor:"W",pieceType:"R"});
alert(tileElement[0].tileColor);
}
</script>
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.javascript
csiph-web