<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>WeStudio技术社区 - JavaScript脚本</title>
    <link>https://www.wareexpress.com/forum/forum.php?mod=forumdisplay&amp;fid=40</link>
    <description>Latest 20 threads of JavaScript脚本</description>
    <copyright>Copyright(C) WeStudio技术社区</copyright>
    <generator>Discuz! Board by Comsenz Inc.</generator>
    <lastBuildDate>Fri, 03 Apr 2026 19:51:39 +0000</lastBuildDate>
    <ttl>60</ttl>
    <image>
      <url>https://www.wareexpress.com/forum/static/image/common/logo_88_31.gif</url>
      <title>WeStudio技术社区</title>
      <link>https://www.wareexpress.com/forum/</link>
    </image>
    <item>
      <title>为什么toFixed()方法报错了？</title>
      <link>https://www.wareexpress.com/forum/forum.php?mod=viewthread&amp;tid=6950</link>
      <description><![CDATA[在我们的日常开发工作中，可能经常会使用到 toFixed()方法来保留浮点数的小数位数，但是需要注意的是Number.toFixed()方法返回的值类型为string（字符串）

如 var a = 3.1415926; 我们要保留两位小数并显示到标签上，那 ...]]></description>
      <category>JavaScript脚本</category>
      <author>hixon</author>
<enclosure url="https://www.wareexpress.com/forum/data/attachment/forum/202211/22/095232rx5lh2t3t4675mt3.png" length="110222" type="image/jpeg" />      <pubDate>Tue, 22 Nov 2022 02:10:28 +0000</pubDate>
    </item>
    <item>
      <title>如何将16进制数组的内容转换成ASCII字符串？</title>
      <link>https://www.wareexpress.com/forum/forum.php?mod=viewthread&amp;tid=6934</link>
      <description><![CDATA[比如接收到的数组内容为  [0x32, 0x33, 0x36, 0x2E, 0x36, 0x38]， 如何让它显示为“236.68” ？ 
我们可以通过 util.cast控件的arrayToUtf8()方法来转换，如下：]]></description>
      <category>JavaScript脚本</category>
      <author>hixon</author>
<enclosure url="https://www.wareexpress.com/forum/data/attachment/forum/202211/03/111810gtoftfceefzt4hoa.png" length="108884" type="image/jpeg" />      <pubDate>Thu, 03 Nov 2022 03:19:01 +0000</pubDate>
    </item>
    <item>
      <title>数组的截取和合并</title>
      <link>https://www.wareexpress.com/forum/forum.php?mod=viewthread&amp;tid=6886</link>
      <description><![CDATA[1、数组的截取：使用slice()方法，可从已有的数组中返回选定的元素，但是它并不会改变原始数组
Array.slice(start, end)返回一个新的数组，包含从 start（包括该元素） 到 end （不包括该元素）的数组对象中的元素


2、数组的合并：使用concat() 方法，用于连接两个或 ...]]></description>
      <category>JavaScript脚本</category>
      <author>hixon</author>
      <pubDate>Tue, 06 Sep 2022 09:25:30 +0000</pubDate>
    </item>
    <item>
      <title>位操作</title>
      <link>https://www.wareexpress.com/forum/forum.php?mod=viewthread&amp;tid=6885</link>
      <description><![CDATA[1、获取某位：移位和与操作
2、设置某位为0：用与操作

3、设置某位为1：用或操作]]></description>
      <category>JavaScript脚本</category>
      <author>hixon</author>
      <pubDate>Tue, 06 Sep 2022 04:56:03 +0000</pubDate>
    </item>
    <item>
      <title>如何使用log10()方法？</title>
      <link>https://www.wareexpress.com/forum/forum.php?mod=viewthread&amp;tid=6883</link>
      <description><![CDATA[在WeStudio使用的JavaScript版本中并没有包含Math.log10()方法，但是里面包含了Math.log()方法，所以我们可以在全局代码里面自己定义一个方法来封装一下log10()



模拟运行一下效果

 ...]]></description>
      <category>JavaScript脚本</category>
      <author>hixon</author>
<enclosure url="https://www.wareexpress.com/forum/data/attachment/forum/202209/05/171132kh252lowop75hhlw.png" length="96133" type="image/jpeg" />      <pubDate>Mon, 05 Sep 2022 09:12:02 +0000</pubDate>
    </item>
    <item>
      <title>如何把科学计数法转换为十进制表示？</title>
      <link>https://www.wareexpress.com/forum/forum.php?mod=viewthread&amp;tid=6630</link>
      <description><![CDATA[将下面的转换方法放到全局代码(init.js)中定义
在按钮的onRelease事件方法中进行测试

测试结果：]]></description>
      <category>JavaScript脚本</category>
      <author>hixon</author>
<enclosure url="https://www.wareexpress.com/forum/data/attachment/forum/202207/12/173408gdo3bobc6j40fo0f.png" length="13148" type="image/jpeg" />      <pubDate>Tue, 12 Jul 2022 09:28:36 +0000</pubDate>
    </item>
    <item>
      <title>字符串的截取</title>
      <link>https://www.wareexpress.com/forum/forum.php?mod=viewthread&amp;tid=6629</link>
      <description><![CDATA[JavaScript 语法中提供了两人个截取字符串的方法，一个是 substring(), 另外一个是 substr()

1、 substring() 提取字符串中两个指定的索引号之间的字符，方法返回的子串包括 开始 处的字符，但不包括 结束 处的字符
语法
string.substring(from, to)


例如：字符串 \&quot;H ...]]></description>
      <category>JavaScript脚本</category>
      <author>hixon</author>
      <pubDate>Mon, 11 Jul 2022 02:21:08 +0000</pubDate>
    </item>
  </channel>
</rss>