Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 17:13
    @mstellaluna banned @cmal
  • Jan 08 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
  • Jul 29 2018 01:00
    @bjorno43 banned @jkyereh
  • Jul 10 2018 22:09
    @bjorno43 banned @manafn
  • Jul 06 2018 15:20
    @texas2010 banned @imlegend19
  • Jul 03 2018 12:28
    @bjorno43 banned @vbvmatta
  • Jun 29 2018 13:54
    @bjorno43 banned @OGTechnoBoy
CamperBot
@camperbot
:star2: 3855 | @khaduch |http://www.freecodecamp.org/khaduch
kerafyrm02
@kerafyrm02
anyone need help/
im here for about 10mins
Emil
@aguyinmontreal
Hi all! Is this valid Javascript/Jquery code? I've never seen that before, especially the |= part.
function markErrorRows($rows, add) { var added = false; $rows.each(function () { added |= markErrorRow($(this), add); }); return added; }
creator0323
@Amasian
How can I change the text of P element after getting P element through document.getElementBy~?n could you give me short example code? thank you
kerafyrm02
@kerafyrm02
<div id="some_container">
  <p id="p_tag">This is text</p>
</div>

var x = document.getElementById('p_tag');
x.innerHTML = 'This is an example';
@emil it's jquery
it goes through each row and using recurssion.
Emil
@aguyinmontreal
|= is recursion?
kerafyrm02
@kerafyrm02
no.
Emil
@aguyinmontreal
what is |= ?
kerafyrm02
@kerafyrm02
Likely a typo. Where do you see that
| means or
creator0323
@Amasian
@kerafyrm02 oh it works! thank you
CamperBot
@camperbot
amasian sends brownie points to @kerafyrm02 :sparkles: :thumbsup: :sparkles:
:cookie: 287 | @kerafyrm02 |http://www.freecodecamp.org/kerafyrm02
Emil
@aguyinmontreal
function markErrorRows($rows, add) { var added = false; $rows.each(function () { added |= markErrorRow($(this), add); }); return added; }
kerafyrm02
@kerafyrm02
I mean where are you copying that from?
Emil
@aguyinmontreal
some project someone else did
kerafyrm02
@kerafyrm02
It's likely an typo
Emil
@aguyinmontreal
what do you think is the correct code?
just = ?
kerafyrm02
@kerafyrm02
I= is c# language
Emil
@aguyinmontreal
what does it mean in c#?
basically the same as:
var x = 3;
x += 3; // x = x + 3;
but instead you use | (or). Whichever is true gets left-assigned
ie
Emil
@aguyinmontreal
so most likely he meant added += markErrorRow($(this), add);
but the var added = false; is making me confuse
because I don't think false += markErrorRow($(this), add); works
kerafyrm02
@kerafyrm02
Actually i just tested it- it works in JS.
var x = 3;
x |= 4; // x = 7
nevermind it doesnt lol
weird results;
Emil
@aguyinmontreal
kerafyrm02
@kerafyrm02
Anyhow-- what's your Q
Stephen James
@sjames1958gm
@kerafyrm02
3 is 011 and 4 is 100 so |= is 111 which is 7
kerafyrm02
@kerafyrm02
^
Yeah- please never do that in your code.. lol.
Emil
@aguyinmontreal
I'm trying to find it's a typo of what
what did he really mean?
kerafyrm02
@kerafyrm02
The bitwise part or the recurssion part?
Emil
@aguyinmontreal
what is the non-bitwise equivalent of "|="?
I think the recursion part is fine, so yes, the weird bitwise typo part.
kerafyrm02
@kerafyrm02
well he was probably trying to be fancy and used the bitwise part- it may not be a typo
you rarely use bitwise in programming. except for maybe a few exceptions
at least in JS
Stephen James
@sjames1958gm
Rarely use it in web programming for sure :)