<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: giranezafiacre</title>
    <description>The latest articles on DEV Community by giranezafiacre (@giranezafiacre).</description>
    <link>https://dev.to/giranezafiacre</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F349899%2F83148e82-4613-471d-bdc2-287b77dc7133.jpg</url>
      <title>DEV Community: giranezafiacre</title>
      <link>https://dev.to/giranezafiacre</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/giranezafiacre"/>
    <language>en</language>
    <item>
      <title>Dealing with objects in javascript</title>
      <dc:creator>giranezafiacre</dc:creator>
      <pubDate>Wed, 28 Apr 2021 16:47:54 +0000</pubDate>
      <link>https://dev.to/giranezafiacre/dealing-with-objects-in-javascript-5hho</link>
      <guid>https://dev.to/giranezafiacre/dealing-with-objects-in-javascript-5hho</guid>
      <description>&lt;p&gt;in javascript, we deal with objects a lot for example in reactjs there is no way you can implement react application without knowing how to manipulate objects. Also, there can be a possibility where you can use objects in sorting data from the database. even some styling frameworks use objects&lt;br&gt;
here I am going to show some ways of using and manipulating objects.&lt;br&gt;
we are going to use the example below:&lt;br&gt;
&lt;em&gt;var Fiacre={&lt;br&gt;
'firstname':'Fiacre',&lt;br&gt;
'lastname':'Giraneza',&lt;br&gt;
'sex':'Male',&lt;br&gt;
'height': 1.75,&lt;br&gt;
'weight':65,&lt;br&gt;
'favoriteColor':'brown'&lt;br&gt;
}&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  To create new field
&lt;/h3&gt;

&lt;p&gt;you may need to add field in object&lt;br&gt;
&lt;em&gt;Fiacre.skills='IT';&lt;br&gt;
//another way&lt;br&gt;
Fiacre['skills']='IT';&lt;br&gt;
console.log('object with added field in Fiacre object:',Fiacre)&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  to update field
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;Fiacre.weight=70;&lt;br&gt;
console.log('updated object:',Fiacre)&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  to read all keys
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;console.log('object keys:',Object.keys(Fiacre))&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  to read all values
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;console.log('object values:',Object.values(Fiacre))&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  to read one field
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;console.log('firstname field:{',Object.keys(Fiacre)[0],':',Object.values(Fiacre)[0],'}')&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  to read one key
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;console.log('firstname key:{',Object.keys(Fiacre)[0],'}')&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  to read on value
&lt;/h3&gt;

&lt;p&gt;*console.log('firstname value:{',Object.values(Fiacre)[0],'}')&lt;br&gt;
console.log('forth way to read firstname:{',Fiacre[Object.keys(Fiacre)[0]],'}')&lt;/p&gt;

&lt;p&gt;console.log('third way to read firstname value:{',Fiacre['firstname'],'}')&lt;br&gt;
console.log('forth way to read firstname value:{',Fiacre.firstname,'}')*&lt;/p&gt;

&lt;h3&gt;
  
  
  to delete field
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;delete Fiacre.favoriteColor;&lt;br&gt;
delete Fiacre['sex'];&lt;br&gt;
console.log('object without favoriteColor and sex:',Fiacre)&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  delete all values in fields
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;Object.keys(Fiacre).forEach(function(key){&lt;br&gt;
    Fiacre[key]='';&lt;br&gt;
})&lt;br&gt;
console.log('empty values in object:',Fiacre)&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  to delete all field
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;Object.keys(Fiacre).forEach(function(key){&lt;br&gt;
    delete Fiacre[key]&lt;br&gt;
})&lt;br&gt;
//or&lt;br&gt;
Fiacre={};&lt;br&gt;
console.log('empty object:',Fiacre)&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  to sort objects in an array based on certain property
&lt;/h3&gt;

&lt;p&gt;you may need to sort objects in array which has same value for certain property.for example:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;let arrayOfObjects=[{&lt;br&gt;
    'id':21058,&lt;br&gt;
    'full name':'Fiacre Giraneza',&lt;br&gt;
    'gender':'male'&lt;br&gt;
},&lt;br&gt;
{&lt;br&gt;
    'id':20938,&lt;br&gt;
    'full name':'Pacifique Tuyizere',&lt;br&gt;
    'gender':'male'&lt;br&gt;
},&lt;br&gt;
{&lt;br&gt;
    'id':20430,&lt;br&gt;
    'full name':'Clemence Nyiramariza',&lt;br&gt;
    'gender':'female'&lt;br&gt;
},&lt;br&gt;
{&lt;br&gt;
    'id':20311,&lt;br&gt;
    'full name':'Celine Mugeni',&lt;br&gt;
    'gender':'female'&lt;br&gt;
}&lt;br&gt;
];&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;const groups = arrayOfObjects.reduce((s, item) =&amp;gt; {&lt;br&gt;
      const group = s[item.gender] || [];&lt;br&gt;
      group.push(item);&lt;br&gt;
      s[item.gender] = group;&lt;br&gt;
      return s;&lt;br&gt;
    }, {});&lt;br&gt;
    //if you display groups it will come as an object which has arrays inside&lt;br&gt;
    console.log(groups)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;thank you Happy coding!!&lt;/p&gt;

</description>
      <category>algorithms</category>
    </item>
    <item>
      <title>how I've demonstrated growth mindset recently.</title>
      <dc:creator>giranezafiacre</dc:creator>
      <pubDate>Wed, 18 Mar 2020 03:42:20 +0000</pubDate>
      <link>https://dev.to/giranezafiacre/how-i-ve-demonstrated-growth-mindset-recently-4io6</link>
      <guid>https://dev.to/giranezafiacre/how-i-ve-demonstrated-growth-mindset-recently-4io6</guid>
      <description>&lt;p&gt;In this post, I would like to show how I have demonstrated a growth mindset recently. We all know that a person who is normal has to grow big every day in all aspects, I mean physically and mentally. Recently I had a challenge in Andela where I had to do something in HTML, CSS, and JavaScript I was a beginner in all those languages but I managed to study them and try to do required tasks on them. I will continue to add on this post. the way you react to change also can define how your mindset is, for example, if we are in the current situation of having this disease disaster of COVID-19 and one maybe he likes to drink beer in the bar. And when he/she continue to put himself/herself in danger by continuing to go to drink beer in the bar it means that he/she can't react well to the change, it makes him/her having the low mindset, in fact for me I like to play soccer recently I stopped playing it because of COVID-19 because I thought that soccer even if I like it I can't die because I don't play it, so that's what growth mindset person should do.&lt;br&gt;
Also, growth mindset is all about how you can learn different aspects quickly and apply it in something necessary as any other one who had already done it, for example, I am trying to do software development while in high school I had studied Mathematics, Physics, and Geography, so I react to change quickly and apply new aspects in software development successfully. also, the growth mindset is all about how you resolve conflicts with colleagues. Growth mindset person is one who knows that there may be conflict(s)because of that everyone wants to reach something, but also to understand each perspective of another so that one may not cross the border of another because I believe that the only way to show the other one to respect your boundary is to show him/her that he/she had crossed it but not by declaring war but the conversation for resolving that issue, I think that show growth mindset also. Another fact that shows that I have a growth mindset is that I don't consider myself like one who knows all, it gives me courage every day of trying to study new things and let other show me how to do things when it is necessary. Growth mindset I believe that it is a key for reaching lifetime achievements because when you don't have one you don't grow at all in all aspects I mean, such as mentally, financially and physically. Other things that prove that I have a growth mindset are that I always try new things so that I can have a good experience life gives and be better because of that.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to build a User Interface from start to finish</title>
      <dc:creator>giranezafiacre</dc:creator>
      <pubDate>Fri, 13 Mar 2020 07:40:31 +0000</pubDate>
      <link>https://dev.to/giranezafiacre/how-to-build-a-user-interface-from-start-to-finish-3c1a</link>
      <guid>https://dev.to/giranezafiacre/how-to-build-a-user-interface-from-start-to-finish-3c1a</guid>
      <description>&lt;p&gt;the way of building an interface,firstly is to think about how many pages you will need,then you implement them after you start with landing page or home page,then you start to put some features needed for header and then section,lastly footer,and then do the same for all other pages and then you start to style them in CSS after you put some java script code to make you user interface behave nicely.&lt;br&gt;
for me when I started user interface for home page I had putted logo and put some small picture in above url for that when user enter in my website know that he/she is in other website,then I style my header features so that it may be positioned rightly,after I have to continue with section it means part below header. I continued with footer where i have putted the address where user can find headquarter and style them.&lt;br&gt;
other page that I had done is login page where I had putted header which seem to be similar like homepage and down I putted form where User can login using his/her username and password then I did the same for signup except that signup has bigger form as I wanted to have many information of user before using website as authenticated user then I had putted some java script so that when user sign up successfully may go to login page and when he/she login successfully may he/she go to user page or admin page when he/she is authenticated.&lt;br&gt;
After all that I went to work on politician page and which had text area which politician express his/her interest to run for the post.&lt;br&gt;
and on user page I had putted option photo which act as anchor tag which show options user can select, the same for admin page the difference is that options are different as their options privileges are different&lt;br&gt;
lastly in all pages there is logo by which when you click it direct to homepage &lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
